Setup local docker repository for local kubernetes cluster

Frank Chung
DeepQ Research Engineering Blog
1 min readJan 24, 2019

Step 1. Run the local repository on server side

$ docker run -d -p 5000:5000 --restart=always --name registry registry:2

Step 2. Try to push and pull images from server side

$ docker tag alpine localhost:5000/alpine
$ docker push localhost:5000/alpine

Then you can check the local repository

$ curl http://localhost:5000/v2/_catalog{"repositories":["alpine"]}

Step 3. Try to push and pull images from remote client

For mac client, update the secure setting in docker preference:

For linux client, update the daemon.json:

$ echo '{ "insecure-registries":    ["xxx.xxx.xxx.xxx:5000"] }' > /etc/docker/daemon.json$ systemctl restart docker

Now we can try to push and pull images from remote server:

$ docker tag alpine xxx.xxx.xxx.xxx:5000/alpine
$ docker push xxx.xxx.xxx.xxx:5000/alpine

Good Luck~

--

--