Push images to Harbor

Prerequisites

  • The Harbor app needs to be activated.
  • The App Platform cluster needs to be configured with certificates (such as Let's Encrypt production certificates).
  • The Download the DOCKERCFG feature needs to be enabled by a platform administrator.
  • Docker needs to be installed on your local (or other development) machine. See Install Docker Engine .

Push images to Harbor

To be able to push images to Harbor, you'll need a robot account with push permissions. Teams are offered the option to download the Docker config for their team's private registry in Harbor.

  1. Log in to the App Platform Console and select Download DOCKERCFG in the left menu. This downloads the docker config file to your local machine.

  2. When you have downloaded the docker config, copy the file to your .Docker folder.

    cp docker-team-labs.json $HOME/.Docker
    
  3. Log in to the Harbor registry through the Docker CLI.

    docker login harbor.<domain-of-your-cluster>
    
  4. Build and tag your image.

    docker build -t harbor.<your-domain>/team-<team-name>/<image-name>:<tag> <path to your Dockerfile>
    
  5. Push the image to Harbor:

    docker push harbor.<your-domain>/team-<team-name>/<image-name>:<tag>