surroundings
The server machine (host name 192.168.1.2): docker private warehouse server, run the registry container
1 download mirrors registry
# docker pull registry
2 pull down to see whether microscope
docker images
3 Run registry container
docker run -itd -v /data/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:latest
Parameter Description
-itd: opens a pseudo-terminal in the container interact, and runs in the background;
-v: the host computer / data / registry directory bound to container / var / lib / registry directory (the directory is stored in a container registry catalog image file), to implement persistent data;
-p: mapping port; port 5000 to access the host will have access to the service registry of the vessel;
-restart = Always: this is the restart strategy, if the container quit unexpectedly will automatically restart a container;
-name Registry: create a container named registry, you can easily name;
Registry: Latest: this is just pull down the mirror;
The remote server must be turned docker remote api (for the maven-docker-plugin package upload)
vim /usr/lib/systemd/system/docker.service
Modify the contents of the following acts ExecStart
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock \
4 本地测试镜像仓库中所有的镜像
curl http://127.0.0.1:5000/v2/_catalog
{“repositories”:[]}
现在是空的,因为才刚运行,里面没有任何镜像内容。