首先登入系统

1、更新全部源内容

sudo apt upgrade

2、进行安装docker及依赖

sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" && sudo apt-get update && sudo apt-get install -y docker-ce

3、配置docker镜像加速

sudo mkdir -p /etc/docker && sudo tee /etc/docker/daemon.json <<-'EOF'

{

  "registry-mirrors": ["https://epsax6ut.mirror.aliyuncs.com"],

  "log-driver":"json-file",

  "log-opts": {"max-size":"10m", "max-file":"3"}

}

EOF

4、刷新参数使参数生效

sudo systemctl daemon-reload

5、重启docker

sudo systemctl restart docker

6、将docker设置开机自启

systemctl enable docker

安装完毕!

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐