Help Center> Cloud Container Engine> FAQ> Image Repository FAQs> How Do I Build a Private Docker Image Repository?

How Do I Build a Private Docker Image Repository?

CCE works with Software Repository for Container (SWR) to create Docker images. SWR can also be used as an independent container image repository.

SWR FAQs

General FAQs

Procedure

  1. Run the following command provided by Docker to build a private image repository:

    docker run –d –p 5000:5000 –v /opt/data/registry:/tmp/registry –restart=always –name= registry-v2-test registry:2

  2. By default, Docker interacts with repositories using the HTTPS protocol. In this example, the private repository uses the HTTP protocol. In this case, add --insecure-registry=192.168.6.94:5000 to the Docker configuration file /usr/lib/systemd/system/docker.service, as shown in the following figure.

  3. Run the following command to restart the Docker client:

    systemctl daemon-reload

    systemctl restart docker

  4. Tag the image before uploading it to the repository.

    docker tag <Current image name> <Target image name>

  5. Upload the image.

    docker push <Image name>

    After the preceding operations are performed, the image can be uploaded to the local private repository.