mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 19:56:09 +01:00
Merge pull request #2026 from wy65701436/1.1.0-document
update compile document
This commit is contained in:
commit
c06abe9b8a
2
Makefile
2
Makefile
@ -88,7 +88,7 @@ MARIADBVERSION=mariadb-10.1.10
|
||||
HTTPPROXY=
|
||||
|
||||
#clarity parameters
|
||||
CLARITYIMAGE=danieljt/harbor-clarity-base[:tag]
|
||||
CLARITYIMAGE=vmware/harbor-clarity-ui-builder[:tag]
|
||||
CLARITYSEEDPATH=/clarity-seed
|
||||
CLARITYBUILDSCRIPT=/entrypoint.sh
|
||||
|
||||
|
@ -4,18 +4,18 @@ This guide provides instructions for developers to build and run Harbor from sou
|
||||
|
||||
## 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 host requires Python, Docker, Docker Compose and golang development environment. Please install the below prerequisites:
|
||||
Harbor is deployed as several Docker containers and most of the code is written in Go language. The build environment requires Python, Docker, Docker Compose and golang development environment. Please install the below prerequisites:
|
||||
|
||||
|
||||
Software | Required Version
|
||||
----------------------|--------------------------
|
||||
docker | 1.10.0 +
|
||||
docker-compose | 1.7.1 +
|
||||
docker | 1.12.0 +
|
||||
docker-compose | 1.11.0 +
|
||||
python | 2.7 +
|
||||
git | 1.9.1 +
|
||||
make | 3.81 +
|
||||
golang* | 1.6.0 +
|
||||
*optional
|
||||
golang* | 1.7.3 +
|
||||
*optional, required only if you use your own Golang environment.
|
||||
|
||||
|
||||
## Step 2: Getting the source code
|
||||
@ -47,10 +47,16 @@ You can compile the code by one of the three approaches:
|
||||
$ docker pull golang:1.7.3
|
||||
```
|
||||
|
||||
* Build, install and bring up Harbor:
|
||||
* Build, install and bring up Harbor without Notary:
|
||||
|
||||
```sh
|
||||
$ make install -e GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage
|
||||
$ make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:0.8.4
|
||||
```
|
||||
|
||||
* Build, install and bring up Harbor with Notary:
|
||||
|
||||
```sh
|
||||
$ make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:0.8.4 NOTARYFLAG=true
|
||||
```
|
||||
|
||||
#### II. Compile code with your own Golang environment, then build Harbor
|
||||
@ -63,40 +69,27 @@ You can compile the code by one of the three approaches:
|
||||
$ mv harbor $GOPATH/src/github.com/vmware/.
|
||||
```
|
||||
|
||||
* Build, install and run Harbor
|
||||
* Build, install and run Harbor without Notary:
|
||||
|
||||
```sh
|
||||
$ cd $GOPATH/src/github.com/vmware/harbor
|
||||
$ make install
|
||||
```
|
||||
|
||||
#### III. Manual build process (compatible with previous versions)
|
||||
* Build, install and run Harbor with Notary:
|
||||
|
||||
```sh
|
||||
$ cd make
|
||||
|
||||
$ ./prepare
|
||||
Generated configuration file: ./config/ui/env
|
||||
Generated configuration file: ./config/ui/app.conf
|
||||
Generated configuration file: ./config/registry/config.yml
|
||||
Generated configuration file: ./config/db/env
|
||||
...
|
||||
|
||||
$ cd dev
|
||||
|
||||
$ docker-compose up -d
|
||||
$ cd $GOPATH/src/github.com/vmware/harbor
|
||||
$ make install -e NOTARYFLAG=true
|
||||
```
|
||||
|
||||
### Verify your installation
|
||||
|
||||
If everyting worked properly, you can get the below message:
|
||||
If everything worked properly, you can get the below message:
|
||||
|
||||
```sh
|
||||
...
|
||||
----Harbor has been installed and started successfully.----
|
||||
|
||||
Now you should be able to visit the admin portal at http://$YOURIP.
|
||||
For more details, please visit https://github.com/vmware/harbor .
|
||||
Start complete. You can visit harbor now.
|
||||
```
|
||||
|
||||
Refer to [Installation and Configuration Guide](installation_guide.md#managing-harbors-lifecycle) for more information about managing your Harbor instance.
|
||||
@ -109,8 +102,11 @@ The `Makefile` contains these configurable parameters:
|
||||
Variable | Description
|
||||
-------------------|-------------
|
||||
BASEIMAGE | Container base image, default: photon
|
||||
CLARITYIMAGE | Clarity UI builder image, default: harbor-clarity-ui-builder
|
||||
DEVFLAG | Build model flag, default: dev
|
||||
COMPILETAG | Compile model flag, default: compile_normal (local golang build)
|
||||
NOTARYFLAG | Notary mode flag, default: false
|
||||
HTTPPROXY | NPM http proxy for Clarity UI builder
|
||||
REGISTRYSERVER | Remote registry server IP address
|
||||
REGISTRYUSER | Remote registry server user name
|
||||
REGISTRYPASSWORD | Remote registry server user password
|
||||
@ -125,11 +121,12 @@ prepare | prepare env
|
||||
compile | compile ui and jobservice code
|
||||
compile_ui | compile ui binary
|
||||
compile_jobservice | compile jobservice binary
|
||||
compile_clarity | compile Clarity binary
|
||||
build | build Harbor docker images (default: using build_photon)
|
||||
build_photon | build Harbor docker images from Photon OS base image
|
||||
install | compile binaries, build images, prepare specific version of compose file and startup Harbor instance
|
||||
start | startup Harbor instance
|
||||
down | shutdown Harbor instance
|
||||
start | startup Harbor instance (set NOTARYFLAG=true when with Notary)
|
||||
down | shutdown Harbor instance (set NOTARYFLAG=true when with Notary)
|
||||
package_online | prepare online install package
|
||||
package_offline | prepare offline install package
|
||||
pushimage | push Harbor images to specific registry server
|
||||
@ -171,4 +168,3 @@ cleanpackage | remove online/offline install package
|
||||
$ make XXXX -e DEVFLAG=false
|
||||
|
||||
```
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
version: '2'
|
||||
services:
|
||||
nodeclarity:
|
||||
image : danieljt/harbor-clarity-base:0.8.1
|
||||
volumes:
|
||||
- ../../src/ui/static/new-ui:/clarity-seed/dist
|
||||
- ../../src/ui_ng:/clarity-seed
|
@ -4,17 +4,23 @@ services:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: make/photon/log/Dockerfile
|
||||
container_name: harbor-log
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/log/harbor/:/var/log/docker/
|
||||
- /var/log/harbor/:/var/log/docker/:z
|
||||
ports:
|
||||
- 1514:514
|
||||
- 127.0.0.1:1514:514
|
||||
networks:
|
||||
- harbor
|
||||
registry:
|
||||
image: library/registry:2.6.0
|
||||
image: vmware/registry:photon-2.6.0
|
||||
container_name: registry
|
||||
restart: always
|
||||
volumes:
|
||||
- /data/registry:/storage
|
||||
- ../common/config/registry/:/etc/registry/
|
||||
- /data/registry:/storage:z
|
||||
- ./common/config/registry/:/etc/registry/:z
|
||||
networks:
|
||||
- harbor
|
||||
environment:
|
||||
- GODEBUG=netdns=cgo
|
||||
command:
|
||||
@ -28,9 +34,12 @@ services:
|
||||
tag: "registry"
|
||||
mysql:
|
||||
build: ../common/db/
|
||||
container_name: harbor-db
|
||||
restart: always
|
||||
volumes:
|
||||
- /data/database:/var/lib/mysql
|
||||
- /data/database:/var/lib/mysql:z
|
||||
networks:
|
||||
- harbor
|
||||
env_file:
|
||||
- ../common/config/db/env
|
||||
depends_on:
|
||||
@ -44,15 +53,18 @@ services:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: make/dev/adminserver/Dockerfile
|
||||
container_name: harbor-adminserver
|
||||
env_file:
|
||||
- ../common/config/adminserver/env
|
||||
restart: always
|
||||
volumes:
|
||||
- /data/config/:/etc/adminserver/config/
|
||||
- /data/secretkey:/etc/adminserver/key
|
||||
- /data/:/data/
|
||||
- /data/config/:/etc/adminserver/config/:z
|
||||
- /data/secretkey:/etc/adminserver/key:z
|
||||
- /data/:/data/:z
|
||||
depends_on:
|
||||
- log
|
||||
networks:
|
||||
- harbor
|
||||
logging:
|
||||
driver: "syslog"
|
||||
options:
|
||||
@ -62,14 +74,17 @@ services:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: make/dev/ui/Dockerfile
|
||||
container_name: harbor-ui
|
||||
env_file:
|
||||
- ../common/config/ui/env
|
||||
restart: always
|
||||
volumes:
|
||||
- ../common/config/ui/app.conf:/etc/ui/app.conf
|
||||
- ../common/config/ui/private_key.pem:/etc/ui/private_key.pem
|
||||
- /data/secretkey:/etc/ui/key
|
||||
- /data/ca_download/:/etc/ui/ca/
|
||||
- ./common/config/ui/app.conf:/etc/ui/app.conf:z
|
||||
- ./common/config/ui/private_key.pem:/etc/ui/private_key.pem:z
|
||||
- /data/secretkey:/etc/ui/key:z
|
||||
- /data/ca_download/:/etc/ui/ca/:z
|
||||
networks:
|
||||
- harbor
|
||||
depends_on:
|
||||
- log
|
||||
- adminserver
|
||||
@ -83,13 +98,16 @@ services:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: make/dev/jobservice/Dockerfile
|
||||
container_name: harbor-jobservice
|
||||
env_file:
|
||||
- ../common/config/jobservice/env
|
||||
restart: always
|
||||
volumes:
|
||||
- /data/job_logs:/var/log/jobs
|
||||
- ../common/config/jobservice/app.conf:/etc/jobservice/app.conf
|
||||
- /data/secretkey:/etc/jobservice/key
|
||||
- /data/job_logs:/var/log/jobs:z
|
||||
- ./common/config/jobservice/app.conf:/etc/jobservice/app.conf:z
|
||||
- /data/secretkey:/etc/jobservice/key:z
|
||||
networks:
|
||||
- harbor
|
||||
depends_on:
|
||||
- ui
|
||||
- adminserver
|
||||
@ -99,13 +117,17 @@ services:
|
||||
syslog-address: "tcp://127.0.0.1:1514"
|
||||
tag: "jobservice"
|
||||
proxy:
|
||||
image: library/nginx:1.11.5
|
||||
image: vmware/nginx:1.11.5-patched
|
||||
container_name: nginx
|
||||
restart: always
|
||||
volumes:
|
||||
- ../common/config/nginx:/etc/nginx
|
||||
- ./common/config/nginx:/etc/nginx:z
|
||||
networks:
|
||||
- harbor
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
- 4443:4443
|
||||
depends_on:
|
||||
- mysql
|
||||
- registry
|
||||
@ -116,3 +138,6 @@ services:
|
||||
options:
|
||||
syslog-address: "tcp://127.0.0.1:1514"
|
||||
tag: "proxy"
|
||||
networks:
|
||||
harbor:
|
||||
external: false
|
||||
|
@ -7,14 +7,13 @@ WORKDIR /go/src/github.com/vmware/harbor/src/ui
|
||||
|
||||
RUN go build -v -a -o /go/bin/harbor_ui
|
||||
|
||||
ENV MYSQL_USR root \
|
||||
MYSQL_PWD root \
|
||||
REGISTRY_URL localhost:5000
|
||||
|
||||
COPY src/ui/views /go/bin/views
|
||||
COPY src/ui/static /go/bin/static
|
||||
COPY src/favicon.ico /go/bin/favicon.ico
|
||||
|
||||
RUN mkdir /go/bin/harbor/
|
||||
COPY VERSION /go/bin/harbor/VERSION
|
||||
|
||||
RUN chmod u+x /go/bin/harbor_ui
|
||||
|
||||
WORKDIR /go/bin/
|
||||
|
@ -1,9 +0,0 @@
|
||||
version: '2'
|
||||
services:
|
||||
nodeclarity:
|
||||
image : danieljt/harbor-clarity-base:0.8.0
|
||||
volumes:
|
||||
- ../src/ui/static/new-ui:/clarity-seed/dist
|
||||
- ../src/ui_ng/src/app:/clarity-seed/src/app
|
||||
depends_on:
|
||||
- ui
|
Loading…
Reference in New Issue
Block a user