Ubuntu linux安装docker
时间: 2024-09-09 18:08:35 浏览: 99
Ubuntu18.04安装Docker
Ubuntu Linux安装Docker的步骤如下:
1. 更新软件包索引:
```bash
sudo apt-get update
```
2. 安装一些必要的系统工具:
```bash
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
```
3. 添加Docker官方的GPG密钥:
```bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```
4. 添加Docker的APT软件源:
```bash
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
```
5. 再次更新软件包索引:
```bash
sudo apt-get update
```
6. 安装Docker CE(社区版):
```bash
sudo apt-get install docker-ce
```
7. 验证Docker是否安装成功并运行:
```bash
sudo systemctl status docker
```
或者运行一个测试镜像来验证Docker是否正常工作:
```bash
sudo docker run hello-world
```
阅读全文