搭建docker registry 镜像仓库

本页内容

搭建 docker registry 镜像仓库

获取镜像

1docker pull registry:2.7.1
1docker pull hyper/docker-registry-web

容器运行

1mkdir -p /opt/data/registry
2docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registry --name registry registry:2.7.1
1docker run -d -p 8080:8080 --name registry-web --link registry \
2   -e REGISTRY_URL=http://192.168.99.146:5000/v2 \
3   -e REGISTRY_TRUST_ANY_SSL=true \
4   -e REGISTRY_BASIC_AUTH="GjhYGDGi2HhkJB" \
5   -e REGISTRY_NAME=192.168.99.146:5000 \
6   hyper/docker-registry-web

上传容器

1vim /etc/docker/daemon.json
2{
3    "insecure-registries": ["192.168.99.146:5000"]
4}
5
6docker tag sjtfreaks/hogo-nginx:v1.1 192.168.99.146:5000/sjtfreaks/hogo-nginx:v1.1
7docker push 192.168.99.146:5000/sjtfreaks/hogo-nginx:v1.1