Ubuntu Docker Way to deploy Docker Registry V2

Source: Internet
Author: User
Tags docker run docker registry

Generate a certificate of your own signature

The process of generating the signature needs to be prompted to enter some parameters, you need to note that when common name needs to enter a domain name that you need, if the internal domain name remember when you need to modify the hosts.

Mkdir/data/certs-p
Cd/data/certs
OpenSSL Req-newkey rsa:4096-nodes-sha256 \
-keyout domain.key-x509-days 365-out DOMAIN.CRT

Running Docker registry Images

Docker run-d-P 443:5000--restart=always--name registry \
>-v/data/certs:/certs \
>-v/data:/var/lib/registry \
>-e registry_http_tls_certificate=/certs/domain.crt \
>-e registry_http_tls_key=/certs/domain.key \
> Registry:2

Client Configuration

Copy the above generated certificate file domain.crt to the /etc/docker/certs.d/domain name/ directory on the client segment machine and rename to Ca.crt

Ubuntu modifies the /etc/default/docker file to add content to the docker_opts :--insecure-registry registry.dev

Restarting the Docker service

Verifying successful Docker Registry validation

The browser accesses the https://domain name/v2/, the display {} succeeds, and if the browser prompts for a certificate security issue, please ignore

Remote push image to registry

Docker tage ubuntu:14.04 domain name/ubuntu:14.04

Docker push Domain/ubuntu:14.04

Browser access https://domain name/v2/_catatlog, will appear {"Repositories": ["Ubuntu"]},

Continue to access Https://registry.dev/v2/ubuntu/tags/list, will display {"Name": "Ubuntu", "tags": ["14.04"]}

Pull Mirror

Docker Pull Domain/ubuntu:14.04

Ubuntu Docker Deployment Docker Registry V2

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.