Pre-requirements on the host and clients:
Installed Docker and Docker-composeHost
Create a folder for Docker registry$ mkdir docker-registry;cd $_;mkdir dataCreate a docker-compose.yml for docker-compose.
Get any image from the hub and tag it to point to your registry:registry:restart: alwaysimage: registry:2ports:- 5000:5000environment:REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /datavolumes:- ./data:/data
$ docker pull ubuntu && docker tag ubuntu localhost:5000/ubuntu
Then, push it to your registry:
$ docker push localhost:5000/ubuntu
Clients
Because the above setting is an insecure and private registry. You need to add --insecure-registry to /etc/default/docker as below.
DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=HOST:5000"
Afterward, you can pull the image from host server by running the below command
$ docker pull HOST:5000
/ubuntu
No comments:
Post a Comment