ubuntu安装docker
ubuntu安装docker
·
首先登入系统
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
安装完毕!
更多推荐
已为社区贡献3条内容
所有评论(0)