Docker's Centos7 Docker private warehouse Building

Source: Internet
Author: User
Tags json tomcat docker run docker registry
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"]}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.