Ubuntu 18.04里面安装docker
时间: 2023-09-19 15:08:36 浏览: 107
Ubuntu18.04 下docker安装部署教程(验证可用)
在Ubuntu 18.04中安装Docker的步骤如下:
1. 首先,更新软件源和升级系统:
```
sudo apt-get update
sudo apt-get upgrade
```
2. 然后,安装Docker:
```
sudo apt install docker -y
```
3. 确认Docker已成功安装:
```
apt list docker
```
4. 查看Docker进程:
```
ps -ef|grep docker
```
如果以上方法无法安装Docker,你可以尝试使用阿里云镜像源来加速下载。以下是使用阿里云镜像源的安装步骤:
1. 更新apt库:
```
sudo apt update
```
2. 安装必要的软件包以允许apt通过HTTPS使用仓库:
```
sudo apt install apt-transport-https ca-certificates curl software-properties-common
```
3. 添加Docker的官方GPG密钥:
```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
```
4. 添加阿里云Docker源:
```
sudo add-apt-repository "deb [arch=amd64 https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
```
5. 再次更新apt库:
```
sudo apt update
```
6. 安装Docker:
```
sudo apt install docker-ce
```
安装完成后,你可以使用Docker来创建和管理容器了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Ubuntu18.04 系统安装 Docker](https://blog.csdn.net/WakingStone/article/details/131697902)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [ubuntu18.04 apt 安装docker(通过阿里云源)](https://download.csdn.net/download/weixin_38517728/14041391)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Ubuntu18.04安装Docker](https://download.csdn.net/download/weixin_38675969/14040601)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文