Search code examples
dockerdocker-composedockerfileboot2dockerdocker-registry

Setting up our own private docker hub


I want to set up my own private docker hub from where I can pull docker images on docker clients.

Taking this link as reference, I executed following commands on one machine:

docker pull registry
docker run -d -p 5000:5000 --name localregistry registry
docker ps
docker pull alpine
docker tag alpine:latest localhost:5000/alpine:latest
docker push localhost:5000/alpine:latest

I want to pull this image on some other machine which is reachable to/from this machine.

$ docker pull <ip_of_machine>:5000/alpine
Using default tag: latest
Error response from daemon: Get https://<ip_of_machine>:5000/v1/_ping: http: server gave HTTP response to HTTPS client

Is it possible to pull docker image from one machine which acts as a docker hub to another machine which is reachable?


Solution

  • Adding below line in docker client machine's /etc/sysconfig/docker file resolved the issue:

    INSECURE_REGISTRY='--insecure-registry <ip>:5000'