This document describes how to store Docker artifacts in CODING-AR for centralized artifact management and version control. The following sections introduce how to create an image, configure authentication, and pull and push artifacts.
Before you begin:
- Install Docker.
- Create an artifact repository (see Basic Operations).
- Select Docker as the repository type.
This section describes how to quickly create a demo Docker image. You can skip this section if you are familiar with Docker images.
In a local directory, create a Dockerfile with the following content:
Run the following command in the directory to build an image.
docker build -t hello-world .
The image is created with a default tag
hello-world:latest. Refer to the Docker documentation for customized tags in the format of
Run the following command in the terminal to pull an image.
docker pull hello-world
Run the following command to view the images pulled.
After creating a local artifact, you can push it to the remote repository. Before the push, you need to locally configure the authentication information of the remote repository.
We recommend you use an access token to generate the authentication configuration.
Click Operation Guide on the repository page.
Enter the login password/two-step verification code and then copy the command generated.
Paste and run the command in the local Docker environment to complete the authentication.
The following commands are for reference only. Use the commands generated in your project.
hello-worldimage pulled in the above section.
The following information will be displayed after the image is pushed successfully.
All the commands described above are displayed in the operation guide. Replace the variables and then run the commands.
After the image is pushed, the activity will be shown in Project Overview.
You can see the hello-world image in the artifact list.
Click the image name to view its information, including overview, guide, properties, and version list.
docker pull to pull a Docker image from CODING-AR. You can use the command generated in the Guide.
The following information will be displayed after the image is pulled successfully.