docker pull registry
1、以下是显示下载完成信息
Using default tag: latest latest: Pulling from library/registry 4064ffdc82fe: Pull complete c12c92d1c5a2: Pull complete 4fbc9b6835cc: Pull complete 765973b0f65f: Pull complete 3968771a7c3a: Pull complete Digest: sha256:51bb55f23ef7e25ac9b8313b139a8dd45baa832943c8ad8f7da2ddad6355b3c8 Status: Downloaded newer image for registry:latest
2、在docker 引擎终端设置
vim /etc/docker/daemon.json { “insecure-registries”: [“192.168.226.128:5000”], //添加 “registry-mirrors”: [“https://05vz3np5.mirror.aliyuncs.com”] }
systemctl restart docker.service
docker create -it registry /bin/bash
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6f7497fcc8c2 registry “/entrypoint.sh /b…” 59 seconds ago Exited (2) 20 seconds ago musing_turing
3、是异常状态
docker start 6f7497fcc8c2
//宿主机的/data/registry自动创建挂载容器中的/tmp/registry docker run -d -p 5000:5000 -v /data/registry:/tmp/registry registry
//更改标记为192.168.226.128:5000/nginx docker tag nginx:latest 192.168.226.128:5000/nginx
//上传 docker push 192.168.226.128:5000/nginx
The push refers to repository [192.168.226.128:5000/nginx] 4fc1aa8003a3: Pushed 5fb987d2e54d: Pushed 831c5620387f: Pushed latest: digest: sha256:189cce606b29fb2a33ebc2fcecfa8e33b0b99740da4737133cdbcee92f3aba0a size: 948
4、获取私有仓库列表
怎么获取registry的镜像仓库中的镜像信息 curl -XGET http://192.168.226.128:5000/v2/_catalog
//显示上传成功 {“repositories”:[“nginx”]}
5、测试私有仓库下载
docker pull 192.168.226.128:5000/nginx
Using default tag: latest latest: Pulling from nginx 000eee12ec04: Pull complete eb22865337de: Pull complete bee5d581ef8b: Pull complete Digest: sha256:189cce606b29fb2a33ebc2fcecfa8e33b0b99740da4737133cdbcee92f3aba0a Status: Downloaded newer image for 192.168.226.128:5000/nginx:latest 192.168.226.128:5000/nginx:latest
|