Build & Push to DIV Harbor

Requirements:

  • Accounted created at DIV Harbor & Acces to a project repositry
  • Harbor CLI Secret
  • Docker
  • custom project with a dockerfile that you want to build and push
Quickstart

Building a project

To build your project, you’ll need to run the following command:

Docker Build Command

sudo docker build -t harbor.divsphere.net/myapp:latest -f Dockerfile .

-t: specifies the tag of the image you need to put it in this format [location]/[yourapp]:[version]

-f: specifies the location of the dockerfile

the . at the end specifies the context it’ll will run in.

Pushing a project

Next you can push it to the registry like this (The push & tag command is also available under the project > push command tab)

Docker Push Command

sudo docker push harbor.divsphere.net/PROJECT-NAME/myapp:latest

After the push you'll need to specify the image that you want to push. For windows you dont have to add the sudo