Docker Registry Installation Simple command implementation _docker

Source: Internet
Author: User
Tags auth docker run docker registry

This article plans to use 3 commands to run a Docker registry is actually very simple

Environment Preparation:

Docker 1.11.2

Compose file Docker-compose.yml

Version: ' 2 ' 
Services: 
  registry: 
    image:registry:2.5.1 
    hostname:registry 
    ports: 
      -" 5000:5000 " 
    Environment: 
      -tz=" Asia/shanghai " 
      -" registry_auth=htpasswd " 
      -" registry_auth_ Htpasswd_realm=registry REALM " 
      -registry_auth_htpasswd_path=/auth/htpasswd 
      -Registry_http_tls_ CERTIFICATE=/CERTS/CRTFILE.CRT 
      -Registry_http_tls_key=/certs/keyfile.key 
    volumes: 
      -/home/soft/ Registry/auth:/auth 
      -/home/soft/registry/certs:/certs 
       
networks: 
 default: 
  external: 
   Name:mynet 

First command:

Docker Pull registry:2.5.1

The second command:

Docker run--entrypoint htpasswd registry:2.5.1-bbn testuser testpassword >/home/soft/registry/auth/htpasswd

The third command:

Docker-compose up-d

Thank you for reading, I hope to help you, thank you for your support for this site!

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.