Ubuntu安装Docker
1、sudo apt-get update
2、sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
3、sudo mkdir -p /etc/apt/keyrings
4、curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg #官方的
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg #更改为阿里的
5、echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null #官方的
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null #更改为阿里的
6、sudo apt-get update
7、sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
8、启动docker
sudo service docker start
9、hello-world
sudo docker run hello-world
阿里云镜像加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://q8yf9et9.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
标签:gpg,sudo,apt,etc,keyrings,Docker,安装,docker
From: https://www.cnblogs.com/chinachuan/p/16866292.html