####0, pull image named registry first:
docker pull registry
####2, Runnging the container with images:
New data dir for registry.
mkdir -p /data/storage/registry
Here, changed the default port 5000 to 5555 in case to port conflict.
docker run -d -p 5555:5000 --restart=always -v /data/storage/registry:/var/lib/registry --name registry registry
####3, Check container
netstat -ntpl|grep 5555
docker ps|grep registry
####4, Usage
Push public image to private registry.
docker pull ubuntu
docker images|grep ubuntu
docker tag ubuntu HOST_IP:5555/ubuntu;v.1
docker push localhost:5555/myfirstimage
docker pull HOST_IP:5555/myfirstimage
Enable it with non-http access,please relace HOST_IP
with approviate value.
sed -i 's;^ExecStart.*;ExecStart=/usr/bin/dockerd --insecure-registry HOST_IP:5555;' /usr/lib/systemd/system/docker.service && \
systemctl daemon-reload && \
systemctl restart docker
end