# ubuntu 安装 docker-ce ## step 1: 安装必要的一些系统工具 sudo apt update sudo apt -y install apt-transport-https ca-certificates curl software-properties-common ## step 2: 安装GPG证书 curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - ## Step 3: 写入软件源信息 sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" ## Step 4: 更新并安装 Docker-CE sudo apt -y update sudo apt -y install docker-ce ## 加速 ``` bash sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://so4p5nnk.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker ``` ## login ``` bash docker login registry.cn-hangzhou.aliyuncs.com ## not to type sudo ``` bash cat /etc/group # if docker grouo not exist , then run this command: sudo groupadd docker sudo gpasswd -a ${USER} docker # add me into docker group sudo service docker restart reboot # or relogin ```