Docker-compose quickly builds steps for Docker private warehouse

Docker-compose quickly builds steps for Docker private warehouse

Create docker-compose.yml and fill in the following content

version: '3'
services:
 registry:
 restart: always
 image: registry:2
 ports:
  - 5000:5000
 environment:
  REGISTRY_HTTP_TLS_CERTIFICATE: /certs/registry.crt
  REGISTRY_HTTP_TLS_KEY: /certs/registry.key
  REGISTRY_AUTH: htpasswd
  REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
  REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
 volumes:
  - /home/docker/registry:/var/lib/registry
  - /home/registry/cert:/certs
  - /home/registry/auth:/auth
 registry-ui:
  image: konradkleine/docker-registry-frontend:v2
  restart: always
  environment:
   -ENV_DOCKER_REGISTRY_HOST=registry
   - ENV_DOCKER_REGISTRY_PORT=5000
   - ENV_DOCKER_REGISTRY_USE_SSL=1
  ports:
   - "5001:80"

Among them, REGISTRY_HTTP_TLS_CERTIFICATE is the SSL certificate. This certificate can be generated by yourself or applied for on websites such as Alibaba Cloud. Since it is a private warehouse, the author recommends using a private certificate

Copy this file and execute the docker-compose up command

Create a login user and password

docker run --entrypoint htpasswd registry:2 -Bbn username password >> /home/registry/auth/htpasswd

Open the browser, enter http://localhost ip:5001 and see the following page, which means the access is successful.

Click on both repositories and a username and password input box will pop up. Enter the username and password created above to view all the images in the repository.

This is the end of this article about the steps to quickly build a docker private warehouse with docker-compose. For more information about building a docker private warehouse with docker compose, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • The process of building a docker registry private warehouse
  • Detailed tutorial on installing harbor private warehouse using docker compose
  • How to use Docker to build a pypi private repository
  • Steps for Docker to build a private warehouse Harbor
  • The process of docker establishing a private warehouse

<<:  XHTML introductory tutorial: Application of table tags

>>:  Solution to MySQL master-slave delay problem

Recommend

A brief discussion on the CSS overflow mechanism

Why do you need to learn CSS overflow mechanism i...

JavaScript implements select all and unselect all operations

This article shares the specific code for JavaScr...

WeChat applet implements text scrolling

This article example shares the specific code for...

How to deploy and start redis in docker

Deploy redis in docker First install Docker in Li...

Example of downloading files with vue+django

Table of contents 1. Overview 2. Django Project 3...

Vue implements interface sliding effect

This article example shares the specific code of ...

How to set focus on HTML elements

Copy code The code is as follows: <body <fo...

Detailed explanation of primary keys and transactions in MySQL

Table of contents 1. Comments on MySQL primary ke...

How to disable ads in the terminal welcome message in Ubuntu Server

If you are using the latest Ubuntu Server version...

Mobile front-end adaptation solution (summary)

I searched online and found that many interviews ...

How to solve the problem that mysql cannot be closed

Solution to mysql not closing: Right-click on the...

TCP socket SYN queue and Accept queue difference analysis

First we must understand that a TCP socket in the...

How to install PostgreSQL11 on CentOS7

Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...

Web Design TabIndex Element

TabIndex is to press the Tab key to sequentially o...