Ubuntu 的docker安装和部署
时间: 2023-10-20 07:01:36 浏览: 114
ubuntu安装docker
好的,下面是Ubuntu上安装和部署docker的步骤:
1.更新包列表:
```
sudo apt-get update
```
2.安装依赖包:
```
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
```
3.添加Docker的官方GPG密钥:
```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
4.添加Docker的官方APT仓库:
```
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```
5.更新包列表:
```
sudo apt-get update
```
6.安装Docker:
```
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
7.启动Docker:
```
sudo systemctl start docker
```
8.检查Docker是否安装成功:
```
sudo docker run hello-world
```
以上就是Ubuntu上安装和部署docker的步骤,希望能对你有所帮助。
阅读全文