1。新建/usr/local/docker/registry 文件夹
2、在registry中新建docker-compose.yml文件,编辑此文件
version: '3.1'
services:
registry:
image: registry:2.7.1
restart: always
container_name: registry
ports:
- 5000:5000
volumes:
- /usr/local/docker/registry/data:/var/lib/registry
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.1.8
- ENV_DOCKER_REGISTRY_PORT=50003.运行 docker-compose up4.上传镜像docker tag tomcat 192.168.1.8:5000/tomcat:8.1
docker push 192.168.1.8:5000/tomcat:8.1