This guide provides instructions for developers to build and run Harbor from source code.
Step 1: Prepare for a build environment for Harbor
Harbor is deployed as several Docker containers and most of the code is written in Go language. The build environment requires Docker, Docker Compose and golang development environment. Please install the below prerequisites:
*optional, required only if you use your own Golang environment.
Step 2: Getting the source code
git clone https://github.com/goharbor/harbor
Step 3: Building and installing Harbor
Copy the file make/harbor.yml.tmp to make/harbor.yml, and make necessary configuration changes such as hostname, admin password and mail server. Refer to
Harbor Installation and Configuration for more info.
Compiling and Running
You can compile the code by one of the two approaches:
I. Build with official Golang image
Build, install and bring up Harbor without Notary:
make install COMPILETAG=compile_golangimage
Build, install and bring up Harbor with Notary:
make install COMPILETAG=compile_golangimage NOTARYFLAG=true
II. Compile code with your own Golang environment, then build Harbor
Move source code to $GOPATH
mv harbor $GOPATH/src/github.com/goharbor/.
Build, install and run Harbor without Notary:
$ make install
Build, install and run Harbor with Notary:
make install -e NOTARYFLAG=true
Verify your installation
If everything worked properly, you will see this message: