Search code examples
dockerdtr

Docker CE on premises with private repository: possible?


I am wondering if it is possible to setup Docker CE on premises with a private repository (using DTR engine or other alternative if they exist)? My company has some strict rules to not have things in the cloud...

I know this is possible with the EE version but I would like to start with the CE version for a few months to see if it will work in our environment.


Solution

  • There are two parts to your question:

    • deploying a registry itself
    • configuring docker engine instances to access the registry

    For deploying the registry all you need to do is deploy it as answered by @sony vizio and outlined here https://docs.docker.com/registry/deploying/#run-a-local-registry

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

    For configuring your docker engines to access this registry you will need to add insecture-registries to /etc/docker/daemon.json (provided the above deployment took place on host registry):

    {
      "insecure-registries": ["registry:5000"]
    }
    

    Images that you push to your local registry will need to be tagged with the registry host:port:

    docker tag myimage registry:5000/myimage
    docker push registry:5000/myimage
    

    and then elsewhere

    docker run registry:5000/myimage