Configure Docker Remote Private Registry

I need some tips on setting up a "remote private docker registry."

README.md in Docker-Registry is mainly focused on a private registry running on the same host, not specifying how other computers can access it remotely (or maybe too hard to understand).

So far I have found these threads:

Docker: a problem with pulling from a private registry from another server (Continuing the discussion of Github gives a hint of a proxy server, but how does it work?)

Create a remote private registry (Maybe itโ€™s closest to what Iโ€™m looking for, but what command do I need to access the registry from other machines?)

How to use your own registry (Again, this focus is on running the registry on the same host. He mentioned running on port 443 or 80 for other machines to access, but you need more details!)

Starting prompts, any input is greatly appreciated!

+6
source share
2 answers

I was able to configure a remote private registry by accessing this: Remote access to a private docker registry

Steps:

  • On the registry node, run docker run -p 5000:5000 registry
  • On the client host, start the Docker service using docker -d --insecure-registry 10.11.12.0:5000 / docker -d --insecure-registry 10.11.12.0:5000 (replace 10.11.12.0 with your own docker -d --insecure-registry 10.11.12.0:5000 IP, and you may want to unmount this process so that it continues to work after closing the shell.)

Edit: Alternatively, you can edit the Docker init script (/ etc / sysconfig / docker for RHEL / CentOS, / var / lib / docker for Ubuntu / Debian). Add this line other_args="--insecure-registry 10.11.12.0:5000" , then run service docker restart . This is the recommended method because it demonizes the Docker process.

Now try if it will work:

  • In the client, upload a busybox image docker pull busybox
  • Give it a new docker tag busybox 10.11.12.0:5000/busybox
  • Click it in the docker push 10.11.12.0:5000/busybox
  • Check pressing docker search 10.11.12.0:5000/busybox
  • Delete all the images and remove them from the docker rmi busybox 10.11.12.0:5000:busybox docker pull 10.11.12.0:5000:busybox
  • Starting docker images should have a freshly extracted image from your own remote private registry.
+5
source

I use a private registry as follows:

  • He has a fully qualified domain name: docker.mycompany.com
  • All the images I create have a name: docker.mycompany.com/image1, docker.mycompany.com/image2, etc.

After that, everything works without problems:

  • Paste the image into the registry:

    docker push docker.mycompany.com/image1

  • Pull and run the image:

    docker run docker.mycompany.com/image2

+2
source

Source: https://habr.com/ru/post/975804/


All Articles