- 官方文檔
https://docs.docker.com/
庫(kù)
https://hub.docker.com/
1、設(shè)置Docker存儲(chǔ)庫(kù)
- 設(shè)置后可以從存儲(chǔ)庫(kù)安裝和更新Docker
1、安裝所需的包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2、設(shè)置穩(wěn)定存儲(chǔ)庫(kù)
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
2、安裝Docker CE
- 安裝最新版Docker
sudo yum install docker-ce docker-ce-cli containerd.io
3、使用阿里云Docker鏡像加速
-
獲取加速器地址
阿里云加速器 - 配置本機(jī)Docker鏡像
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://xxxxxx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
4、運(yùn)行HelloWorld
docker run hello-world
//本地沒(méi)找到,到遠(yuǎn)程庫(kù)獲取
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:0e11c388b664df8a27a901dce21eb89f11d8292f7fca1b3e3c4321bf7897bffe
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
