Enterprise Self-use Docker Registry V2 mirrored Warehouse

Source: Internet
Author: User
Tags docker registry

1.  Install the Docker engine and start the Docker service 2.  generate the self-visa book, the script is as follows crt.sh:    #!/bin/bash     #  generate self-visa book script          #common  name default is host name       #CN = ' hostname '     cn= ' Docker.repo '      #证书名      crtname= ' Registry '         mkdir certs;cd certs         openssl req -x509 -days 3650 -subj  "/ cn=${cn}/" -nodes -newkey rsa:4096 -sha256 -keyout ${crtname}.key -out  ${CrtName}.crt3.  download Docker-compose (container):     $ curl -l https:// github.com/docker/compose/releases/download/1.7.0/run.sh > /usr/local/bin/docker-compose4.  Writing Docker-compose.yml    registry_web:        image :  ' Hyper/docker-registry-web '         ports:             -  "80:8080"         restart: always         links:             - registry        environment:             - REGISTRY_HOST=registry             - REGISTRY_PORT=5000             - TRUST_ANY_SSL=true             registry:        image:  ' Registry : 2.2.1 '         ports:             - " 443:5000 "        restart: always         volumes:            - ./ certs:/certs            - /dockrepo:/var/lib/ registry        environment:             - REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.crt             - REGISTRY_HTTP_TLS_KEY=/certs/registry.key             - REGISTRY_STORAGE_DELETE_ENABLED=true                   5.  The docker-compose up -d 6.  client needs to do is:    1.  copy Registry.crt to/etc/ Docker/certs.d/docker.Repo (that is, the CN specified when the certificate was created)/    2. echo  ' Registry_ip   docker.repo '   >> /etc/hosts    7.  push and pull mirrors, Eg:    docker push  docker.repo/busybox    docker pull docker.repo/busybox8.  can be accessed via a browser, View the image in registry:     http://docker.repo/


This article is from the "Everything Possible" blog, please be sure to keep this source http://noican.blog.51cto.com/4081966/1769825

Enterprise Self-use Docker Registry V2 mirrored Warehouse

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.