Since our company uses Registry, even though we feel uncomfortable, we still need to beautify it as much as possible. After all, we use and maintain it ourselves. Therefore, we plan to go to webUI, please don’t ask why we don’t use Harbor, because what the boss said is right.

Two are recommended here

Set up registry repository

docker pull registry:latest docker run -d -p 5000:5000 --restart=always --name registry registry:latest docker tag Minio/minio 192.168.11.20:5000 / minio/minio docker push 192.168.11.20:5000 / minio/minio curl http://192.168.11.20:5000/v2/_catalogCopy the code

Curl port, the result is as follows

[root @ localhost mysql] # curl http://192.168.11.20:5000/v2/_catalog {" repositories: "[the]} [root @ localhost docker] # curl http://192.168.11.20:5000/v2/_catalog {" repositories: "[" minio/minio"]}Copy the code

Q:

A Get HTTP: https://192.168.11.20:5000/v2/: server gave, the HTTP response to HTTPS clientCopy the code

A:

Json {"insecure-registries":["192.168.11.20:5000"]} systemctl daemon-reload systemctl restart dockerCopy the code

Docker-Registry-Frontend

docker-compose.yaml

Version: '3.1' services: Frontend: image: Konradkleine /docker-registry-frontend:v2 ports: -8080/80 Volumes: - ./certs/frontend.crt:/etc/apache2/server.crt:ro - ./certs/frontend.key:/etc/apache2/server.key:ro environment: - ENV_DOCKER_REGISTRY_HOST = 192.168.11.20 - ENV_DOCKER_REGISTRY_PORT = 5000Copy the code

docker-compose up -d

Browser visit: http://192.168.11.20:8080/home

Docker-Registry-Web

mkdir -p hyper-docker-registry-web-config/frontend hyper-docker-registry-web-config/registry
cd hyper-docker-registry-web-config
Copy the code

vim registry/config.yml

Version: 0.1 log: level: info Formatter: text Fields: service: Registry - SRV environment: Production Storage: Cache: Layerinfo: inmemory filesystem: rootDirectory: /var/lib/registry delete: true http: addr: :5000 debug: addr: :5001Copy the code

ui

vim frontend/config.yml

Registry: # Docker registry url url: http://912.168.11.20:5000/v2 # Docker registry FQDN name: localhost:10050 # To allow image delete, should be false readonly: false auth: # Disable authentication enabled: trueCopy the code
docker run -d -p 10050:5000 --restart=always --name registry-srv -v $(pwd)/registry/:/etc/docker/registry:ro -v /var/lib/registry/storage:/var/lib/registry registry:2



docker run -d -p 10080:8080  --name registry-web --link registry-srv -v $(pwd)/frontend/:/conf/:ro hyper/docker-registry-web

Copy the code

Browser visit: http://192.168.11.20:10080