docker Mirror private warehouse

Two centos7 machines

192.168.100.151 docker Mirror

192.168.100.157 docker private warehouse

 

step one

192.168.100.157 host open private warehouse functions

docker run -d -p 5000:5000 --restart=always --name registry registry

 

Step Two

192.168.100.151 Host Configuration

New daemon.json file 

vim / etc / Docker / daemon.json 

add content about 

{ 
  " Registry-Mirror " : [
     " https://registry.docker-cn.com " 
  ], 
  " in the insecure-Registries " : [
     " 192.168. 199.100: 5000 " 
  ] 
} 

save and exit
Modify the configuration docker.service, you add the following 

Vim / lib / systemd / System / docker.service 

EnvironmentFile = - / etc / Docker / daemon.json

Restart docker

systemctl restart docker

 

Step Three

Push image to a private warehouse

docker push 192.168.100.157:5000/hello-world

 

Note that image needs to have tag192.168.100.157: 5000, or will be error

 

Guess you like

Origin www.cnblogs.com/soymilk2019/p/11519939.html