Docker Xiaobai from zero entry to actual combat series [2]

1. Install Centos 7

2. Close SELINUX

sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
setenforce 0
getenforce 

3. Configure Alibaba Cloud Mirror

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://8r0xukw1.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

4.停止所有container

docker stop $(docker ps -a -q)

5. Delete all containers

docker rm $(docker ps -a -q)

6. Delete all images

docker rmi $(docker images -q)

 7.

1. Host A has mirrored nginx with version v1.0. Execute the command:
docker save nginx:v1.0 -o /root/nginx.tar  ---> Save nginx:v1.0 as an nginx.tar package
2. Copy the nginx.tar package to host B through the scp command.
3. Execute the command on host B:
docker load -i /root/nginx.tar  ---> load from nginx.tar package to mirror nginx:v1.0

Note: Execute the docker save nginx:v1.0 -o /root/nginx.tar command, if the version v1.0 is not added, all versions of nginx images on host A will be saved to an nginx.tar package

 

 

Reference blog: https://blog.csdn.net/silentwolfyh/article/details/52354402

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325168168&siteId=291194637