How to Setup Docker Private Registry on CentOS 7.x / RHEL 7.x

7 Responses

  1. Anders Jackson says:

    Good article, and it is posible to move this to Ubuntu, by using ufw(8) instead of firewall-cmd(8).

    But how do we secure the repository? Shouldn’t it be using https instead of http?

  2. James Yu says:

    Hi, I just followed through your post and found out the –insecure-registry setting does not work, maybe a hand?
    The setting is as follows:
    # cat /usr/lib/systemd/system/docker.service
    Description=Docker Application Container Engine
    Documentation= firewalld.service

    # the default is not to use systemd for cgroups because the delegate issues still
    # exists and systemd currently does not support the cgroup feature set required
    # for containers run by docker
    ExecStart=/usr/bin/dockerd –-insecure-registry boot-node:5000
    ExecReload=/bin/kill -s HUP $MAINPID
    # Having non-zero Limit*s causes performance problems due to accounting overhead
    # in the kernel. We recommend using cgroups to do container-local accounting.
    # Uncomment TasksMax if your systemd version supports it.
    # Only systemd 226 and above support this version.
    # set delegate yes so that systemd does not reset the cgroups of docker containers
    # kill only the docker process, not all processes in the cgroup
    # restart the docker process if it exits prematurely


    also I have boot-node
    in /etc/hosts

    • James Yu says:

      after I change “ boot-node” to “ boot-node boot-node” in /etc/hosts
      and change “/usr/bin/dockerd –insecure-registry boot-node:5000” to “/usr/bin/dockerd –insecure-registry=boot-node:5000” for ExecStart
      it starts to work

  3. nag says:

    By using this I am not able to push images getting the below response
    Get ‘https://x.x.x.x:5000/v2/:’ http: server gave HTTP response to HTTPS client

    • Pradeep Kumar says:

      Hi Nag,

      Did you update your system’s ‘/usr/lib/systemd/system/docker.service’ file and reload daemon service and restart Docker service ..?

  4. Vijay says:

    how can we get the list of all the images inside a registry?

    • Pradeep Kumar says:

      From any of the docker Engine node, run the “docker images” command to see the images inside your registry.

Leave a Reply to James Yu Cancel reply

Your email address will not be published. Required fields are marked *