This section walks you through the steps of uploading an image to SWR through the client by taking the nginx:v1 image built in Basics of the Container Engine as an example. Uploading an image through the client is to run Docker commands on the client where Docker is installed to push the image to an image repository of SWR.
Each image layer uploaded through the client cannot exceed 10 GB.
{ "insecure-registries": [ "{Intranet address}" ] }
To obtain the value of {Intranet address}, log in to the SWR console. On the Dashboard page, click Generate Login Command and obtain the private network address (IP:20202) in the private network command.
If insecure-registry has been configured in the DOCKER_OPTS configuration item in the /etc/default/docker file, you do not need to modify the /etc/docker/daemon.json file.
Run the following command to add the private network IP address to the end of the DOCKER_OPTS configuration item:
vi /etc/default/docker
Example:
# Use DOCKER_OPTS to modify the daemon startup options. DOCKER_OPTS="--insecure-registry={existing configurations} --insecure-registry={Intranet address}"
sudo systemctl restart docker
The message "Login Succeeded" will be displayed upon a successful login.
docker tag [Image name 1:tag 1] [Image repository address]/[Organization name]/[Image name 2:tag 2]
In the preceding command:
Example:
docker tag nginx:v1 swr.eu-de.otc.t-systems.com/group/nginx:v1
docker push [Image repository address]/[Organization name]/[Image name 2:tag 2]
Example:
docker push swr.eu-de.otc.t-systems.com/group/nginx:v1
The following information will be returned upon a successful push:
6d6b9812c8ae: Pushed 695da0025de6: Pushed fe4c16cbf7a4: Pushed v1: digest: sha256:eb7e3bbd8e3040efa71d9c2cacfa12a8e39c6b2ccd15eac12bdc49e0b66cee63 size: 948
To view the pushed image, refresh the My Images page.