• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide 2.0
  4. Image Repository
  5. Connecting to the Private Container Registry

Connecting to the Private Container Registry

Before you upload container images, ensure that your local Docker client can access the private container registry.

Prerequisites

Procedure

  1. Log in to the CCE console. In the navigation pane, choose Image Repository. Click any image repository name to go to the details page. Obtain the image address from Step 1. Obtain the image repository address on the Pull/Push Guide tab page.

    If you are uploading an image from an internal network, obtain the internal image address. If you are uploading an image from an external network, obtain the external image address.

  2. Log in to your Docker client as the root user.
  3. Authorize the Docker client to access the private container registry.

    NOTE:

    Settings of Docker parameters vary with Docker version and OS. For more information on how to configure Docker parameters, visit https://docs.docker.com/datacenter/dtr/2.0/configure/config-security/.

    • Ubuntu 14.04:

      Run the following command to add the container registry address obtained in 1 to the end of the DOCKER_OPTS="--insecure-registry" line:

      vi /etc/default/docker

      Expected settings:

      # Use DOCKER_OPTS to modify the daemon startup options.
      DOCKER_OPTS="--insecure-registry {container_registry_address}"

      Run the following command to restart Docker:

      service docker restart

    • Ubuntu 16.04:
      Add the container registry address obtained in 1 as the value of the  insecure-registries parameter in the  /etc/docker/daemon.json file.
      {
      "insecure-registries": ["{container_registry_address}"]
      }

      Run the following commands to restart Docker:

      systemctl daemon-reload

      service docker restart

    • CentOS and similar distributions (for example, CentOS 7.3):
      NOTE:

      If a cluster node serves as your Docker client, configure Docker parameters in the same manner as when your Docker client runs CentOS or a similar distribution.

      Run the following command to obtain the path in which the Docker configuration file is located:

      service docker status

      At the line starting with Loaded, you will find the path in which the Docker configuration file is located.

      Example command output:

      # service docker status
      Redirecting to /bin/systemctl status docker.service
      docker.service - Docker Application Container Engine
         Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
         Active: active (running) since Sat 2017-05-20 10:41:14 CST; 16min ago
           Docs: https://docs.docker.com

      Run the following command to append the container registry address obtained in 1 to the "--insecure-registry" at the line starting with ExecStart:

      vi /usr/lib/systemd/system/docker.service

      Expected settings:

      [Service]
      Type=notify
      ExecStart=/usr/bin/dockerd  --insecure-registry {container_registry_address}

      Run the following commands to restart Docker:

      systemctl daemon-reload

      service docker restart

    • OSX:

      On the Daemon tab page of the Docker GUI, add the container registry address obtained in 1 to the Insecure registries list. Then restart Docker.

    • Windows 10:

      On the Daemon tab page of the Docker GUI, add the container registry address obtained in 1 to the Insecure registries list. Then restart Docker.

    • OS Yosemite 10.10.2 or earlier; Windows 7 or earlier:
      1. Run the docker-machine ssh or boot2docker ssh command to log in to your Docker client.
      2. Add the container registry address obtained in 1 to the configuration option EXTRA_ARGS in the /var/lib/boot2docker/profile file of your Docker client.
      EXTRA_ARGS='
      --label provider=virtualbox
      --insecure-registry {container_registry_address}
      '
      CACERT=/var/lib/boot2docker/ca.pem
      DOCKER_HOST='-H tcp://10.0.0.0:2376'
      DOCKER_STORAGE=aufs
      DOCKER_TLS=auto
      SERVERKEY=/var/lib/boot2docker/server-key.pem
      SERVERCERT=/var/lib/boot2docker/server.pem

      Run the following command to restart Docker:

      service docker restart