Loading

Ubuntu18.04安装docker

 

1.卸载

sudo apt-get remove docker docker-engine docker.io containerd runc

2.安装Docker

sudo apt-get update
# 安装依赖包
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# 添加 Docker 的官方 GPG 密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 验证您现在是否拥有带有指纹的密钥
sudo apt-key fingerprint 0EBFCD88
# 设置稳定版仓库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

3.安装 Docker Engine-Community

# 更新
$ sudo apt-get update
# 安装最新的Docker-ce 
sudo apt-get install docker-ce
# 启动
sudo systemctl enable docker
sudo systemctl start docker

4.测试

sudo docker run hello-world

 

安装docker-compose

1.进入https://github.com/docker/compose/releases 查看最新版本,当前版本为1.23.1

sudo curl -L https://github.com/docker/compose/releases/download/1.23.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

2.设置权限

sudo chmod +x /usr/local/bin/docker-compose

3.查看是否安装成功

docker-compose --version
posted @ 2020-10-30 15:37  Ellisonzhang  阅读(4234)  评论(0编辑  收藏  举报