
Image naming
Every image in Harbor follows this fully-qualified name:
<registry>/<project>/<repository>:<tag>
For example: registry.europeanweather.cloud/myproject/myapp:1.4.0
The <registry>/<project> prefix tells the container engine (e.g. docker or podman) where to push, so the project must already exist and you must have push permission on it.
Pushing an image
1. Build the image
As first step it is required to build an image, which is typically done by using one container engine platform such as docker or podman , e.g. by running in the directory containing a Dockerfile (or general Containerfile) the command:
Docker $ docker build -t myapp:1.4.0 . |
|
Podman $ podman build -t myapp:1.4.0 . |
|
|
2. Tag it for Harbor
Re-tag the local image with the full Harbor name:
Docker $ docker tag myapp:1.4.0 registry.europeanweather.cloud/myproject/myapp:1.4.0 |
|
Podman $ podman tag myapp:1.4.0 registry.europeanweather.cloud/myproject/myapp:1.4.0 |
|
|
3. Login
If not yet done, it is necessary to login to the container registry by using a robot account
Docker $ docker login registry.europeanweather.cloud -u 'robot$myproject+robotname' -p '<robot-token>' |
|
Podman $ podman login registry.europeanweather.cloud -u 'robot$myproject+robotname' -p '<robot-token>' |
|
|
4. Push
Docker $ docker push registry.europeanweather.cloud/myproject/myapp:1.4.0 |
|
Podman $ podman push registry.europeanweather.cloud/myproject/myapp:1.4.0 |
|
|
Docker/Podman uploads each layer; layers that already exist in Harbor are skipped. When it finishes, the image appears under the project in the web UI.
Pulling an image
1. Login (private project/repositories)
For pulling images from private project repositories, it is necessary to login to the container registry by using a robot account:
Docker $ docker login registry.europeanweather.cloud -u 'robot$myproject+robotname' -p '<robot-token>' |
|
Podman $ podman login registry.europeanweather.cloud -u 'robot$myproject+robotname' -p '<robot-token>' |
|
|
2. Pull
Docker $ docker pull registry.europeanweather.cloud/myproject/myapp:1.4.0 |
|
Podman $ podman pull registry.europeanweather.cloud/myproject/myapp:1.4.0 |
|
|