Installation Environment Preparation
Linux kernel version
Uname-a
Docker version
sudo docker version
Installing Docker Registry
sudo docker run-d-v/home/hzq/registry:/var/lib/registry-p 5000:5000--restart=always--privileged=true--name registr Y registry:latest
-v/home/hzq/registry:/var/lib/registry by default, the warehouse is stored in the/var/lib/registry directory within the container, specifying the local directory to mount to the container.
-P 5,000:5,000 Port mapping
--RESTART=ALWAYS1 Always restarts the container when the container exits, mainly in the production environment
--privileged=true in CentOS7 security module SELinux to disable the permissions, parameters to the container plus privileges, without uploading the image will report permissions error OSError: [Errno] Permission denied: '/tmp/ Registry/repositories/liibrary ') or (Received unexpected HTTP status:500 Internal Server error)
--name registry The name of the specified container
By executing the Run command above, we have actually completed the construction of the Docker private warehouse. Very simple answer ... Below we are testing using the following. use of Docker Registry push Tomcat to the registry warehouse To modify a label by using the tag command
sudo docker tag Tomcat Localhost:5000/tomcat push to warehouse
sudo docker push Localhost:5000/tomcat
problems encountered in the use 1, Get https://192.168.49.132:5000/v1/_ping:Tunnel Connection Failed
Solution:
Modify Daemon.json file sudo vim/etc/docker/daemon.json
Add: {"insecure-registries": ["192.168.49.132:5000"]}