Docker remote test environment to build a private warehouse registry ---

surroundings

End test machine (host name 192.168.1.10): Remote test private warehouse server
test image warehouse (test end operation)

Download busybox Mirror

docker pull busybox

docker images

Mirror tagging

docker tag busybox:latest  192.168.1.2:5000/busybox:v1

Format Description: Usage: docker tag SOURCE_IMAGE [: TAG] TARGET_IMAGE [: TAG]

busybox: lastest This is the source image, but also just pull down the image file;
192.168.1.2:5000/busybox:v1: This is the target image, but also the private registry mirror server IP address and port;

View tag

docker images

Upload Mirror

docker push 192.168.1.2:5000/busybox:v1 

Note, this is being given, the method requires https to upload, we can modify at daemon.json to solve:

vim /etc/docker/daemon.json

{
  "registry-mirrors": ["http://f2d6cb40.m.daocloud.io","http://hub-mirror.c.163.com","https://registry.cn-shenzhen.aliyuncs.com"],
  "insecure-registries": ["192.168.1.20:5000"]
}

Add Address Private mirror server, pay attention to writing format is json, there are strict requirements to write, and then restart the docker services:

systemctl  restart docker

Upload it again

First remove the mirror on the host:

docker rmi -f $(docker images -aq)

Look at the image on the host delete all:

docker images

Then, download the image from the registry server busybox:

docker pull 192.168.1.2:5000/busybox:v1

Check whether to download image

docker images

All the mirrors on the server list

curl  http://192.168.1.2:5000/v2/_catalog

 

Guess you like

Origin www.cnblogs.com/wdzhz/p/10973432.html