安装Docker

使用我预先准备好的一键部署脚本:

sudo curl -s https://gitee.com/maxidea/shell/raw/master/docker-install.sh | bash

或:

手动安装步骤:

参考:阿里云镜像 https://developer.aliyun.com/mirror/docker-ce

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

/etc/docker下创建daemon.json

加入镜像加速地址:

{ 
        "exec-opts": ["native.cgroupdriver=systemd"],
        "registry-mirrors": ["https://r9xxm8z8.mirror.aliyuncs.com", "https://registry.docker-cn.com", "https://docker.mirrors.ustc.edu.cn" ]
} 

启动docker:

sudo systemctl start docker

查看docker状态:

sudo docker info

查看docker指令:

docker run --help

Last updated