Merge pull request #2026 from wy65701436/1.1.0-document

update compile document
This commit is contained in:
Yan 2017-04-17 22:16:15 -07:00 committed by GitHub
commit c06abe9b8a
6 changed files with 87 additions and 83 deletions

View File

@ -88,7 +88,7 @@ MARIADBVERSION=mariadb-10.1.10
HTTPPROXY= HTTPPROXY=
#clarity parameters #clarity parameters
CLARITYIMAGE=danieljt/harbor-clarity-base[:tag] CLARITYIMAGE=vmware/harbor-clarity-ui-builder[:tag]
CLARITYSEEDPATH=/clarity-seed CLARITYSEEDPATH=/clarity-seed
CLARITYBUILDSCRIPT=/entrypoint.sh CLARITYBUILDSCRIPT=/entrypoint.sh

View File

@ -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 ## 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 Software | Required Version
----------------------|-------------------------- ----------------------|--------------------------
docker | 1.10.0 + docker | 1.12.0 +
docker-compose | 1.7.1 + docker-compose | 1.11.0 +
python | 2.7 + python | 2.7 +
git | 1.9.1 + git | 1.9.1 +
make | 3.81 + make | 3.81 +
golang* | 1.6.0 + golang* | 1.7.3 +
*optional *optional, required only if you use your own Golang environment.
## Step 2: Getting the source code ## 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 $ docker pull golang:1.7.3
``` ```
* Build, install and bring up Harbor: * Build, install and bring up Harbor without Notary:
```sh ```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 #### 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/. $ mv harbor $GOPATH/src/github.com/vmware/.
``` ```
* Build, install and run Harbor * Build, install and run Harbor without Notary:
```sh ```sh
$ cd $GOPATH/src/github.com/vmware/harbor $ cd $GOPATH/src/github.com/vmware/harbor
$ make install $ make install
``` ```
#### III. Manual build process (compatible with previous versions) * Build, install and run Harbor with Notary:
```sh ```sh
$ cd make $ cd $GOPATH/src/github.com/vmware/harbor
$ make install -e NOTARYFLAG=true
$ ./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
``` ```
### Verify your installation ### Verify your installation
If everyting worked properly, you can get the below message: If everything worked properly, you can get the below message:
```sh ```sh
... ...
----Harbor has been installed and started successfully.---- Start complete. You can visit harbor now.
Now you should be able to visit the admin portal at http://$YOURIP.
For more details, please visit https://github.com/vmware/harbor .
``` ```
Refer to [Installation and Configuration Guide](installation_guide.md#managing-harbors-lifecycle) for more information about managing your Harbor instance. 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 Variable | Description
-------------------|------------- -------------------|-------------
BASEIMAGE | Container base image, default: photon BASEIMAGE | Container base image, default: photon
CLARITYIMAGE | Clarity UI builder image, default: harbor-clarity-ui-builder
DEVFLAG | Build model flag, default: dev DEVFLAG | Build model flag, default: dev
COMPILETAG | Compile model flag, default: compile_normal (local golang build) 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 REGISTRYSERVER | Remote registry server IP address
REGISTRYUSER | Remote registry server user name REGISTRYUSER | Remote registry server user name
REGISTRYPASSWORD | Remote registry server user password REGISTRYPASSWORD | Remote registry server user password
@ -125,11 +121,12 @@ prepare | prepare env
compile | compile ui and jobservice code compile | compile ui and jobservice code
compile_ui | compile ui binary compile_ui | compile ui binary
compile_jobservice | compile jobservice binary compile_jobservice | compile jobservice binary
compile_clarity | compile Clarity binary
build | build Harbor docker images (default: using build_photon) build | build Harbor docker images (default: using build_photon)
build_photon | build Harbor docker images from Photon OS base image 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 install | compile binaries, build images, prepare specific version of compose file and startup Harbor instance
start | startup Harbor instance start | startup Harbor instance (set NOTARYFLAG=true when with Notary)
down | shutdown Harbor instance down | shutdown Harbor instance (set NOTARYFLAG=true when with Notary)
package_online | prepare online install package package_online | prepare online install package
package_offline | prepare offline install package package_offline | prepare offline install package
pushimage | push Harbor images to specific registry server pushimage | push Harbor images to specific registry server
@ -171,4 +168,3 @@ cleanpackage | remove online/offline install package
$ make XXXX -e DEVFLAG=false $ make XXXX -e DEVFLAG=false
``` ```

View File

@ -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

View File

@ -4,17 +4,23 @@ services:
build: build:
context: ../../ context: ../../
dockerfile: make/photon/log/Dockerfile dockerfile: make/photon/log/Dockerfile
container_name: harbor-log
restart: always restart: always
volumes: volumes:
- /var/log/harbor/:/var/log/docker/ - /var/log/harbor/:/var/log/docker/:z
ports: ports:
- 1514:514 - 127.0.0.1:1514:514
networks:
- harbor
registry: registry:
image: library/registry:2.6.0 image: vmware/registry:photon-2.6.0
container_name: registry
restart: always restart: always
volumes: volumes:
- /data/registry:/storage - /data/registry:/storage:z
- ../common/config/registry/:/etc/registry/ - ./common/config/registry/:/etc/registry/:z
networks:
- harbor
environment: environment:
- GODEBUG=netdns=cgo - GODEBUG=netdns=cgo
command: command:
@ -28,9 +34,12 @@ services:
tag: "registry" tag: "registry"
mysql: mysql:
build: ../common/db/ build: ../common/db/
container_name: harbor-db
restart: always restart: always
volumes: volumes:
- /data/database:/var/lib/mysql - /data/database:/var/lib/mysql:z
networks:
- harbor
env_file: env_file:
- ../common/config/db/env - ../common/config/db/env
depends_on: depends_on:
@ -44,15 +53,18 @@ services:
build: build:
context: ../../ context: ../../
dockerfile: make/dev/adminserver/Dockerfile dockerfile: make/dev/adminserver/Dockerfile
container_name: harbor-adminserver
env_file: env_file:
- ../common/config/adminserver/env - ../common/config/adminserver/env
restart: always restart: always
volumes: volumes:
- /data/config/:/etc/adminserver/config/ - /data/config/:/etc/adminserver/config/:z
- /data/secretkey:/etc/adminserver/key - /data/secretkey:/etc/adminserver/key:z
- /data/:/data/ - /data/:/data/:z
depends_on: depends_on:
- log - log
networks:
- harbor
logging: logging:
driver: "syslog" driver: "syslog"
options: options:
@ -62,14 +74,17 @@ services:
build: build:
context: ../../ context: ../../
dockerfile: make/dev/ui/Dockerfile dockerfile: make/dev/ui/Dockerfile
container_name: harbor-ui
env_file: env_file:
- ../common/config/ui/env - ../common/config/ui/env
restart: always restart: always
volumes: volumes:
- ../common/config/ui/app.conf:/etc/ui/app.conf - ./common/config/ui/app.conf:/etc/ui/app.conf:z
- ../common/config/ui/private_key.pem:/etc/ui/private_key.pem - ./common/config/ui/private_key.pem:/etc/ui/private_key.pem:z
- /data/secretkey:/etc/ui/key - /data/secretkey:/etc/ui/key:z
- /data/ca_download/:/etc/ui/ca/ - /data/ca_download/:/etc/ui/ca/:z
networks:
- harbor
depends_on: depends_on:
- log - log
- adminserver - adminserver
@ -83,13 +98,16 @@ services:
build: build:
context: ../../ context: ../../
dockerfile: make/dev/jobservice/Dockerfile dockerfile: make/dev/jobservice/Dockerfile
container_name: harbor-jobservice
env_file: env_file:
- ../common/config/jobservice/env - ../common/config/jobservice/env
restart: always restart: always
volumes: volumes:
- /data/job_logs:/var/log/jobs - /data/job_logs:/var/log/jobs:z
- ../common/config/jobservice/app.conf:/etc/jobservice/app.conf - ./common/config/jobservice/app.conf:/etc/jobservice/app.conf:z
- /data/secretkey:/etc/jobservice/key - /data/secretkey:/etc/jobservice/key:z
networks:
- harbor
depends_on: depends_on:
- ui - ui
- adminserver - adminserver
@ -99,13 +117,17 @@ services:
syslog-address: "tcp://127.0.0.1:1514" syslog-address: "tcp://127.0.0.1:1514"
tag: "jobservice" tag: "jobservice"
proxy: proxy:
image: library/nginx:1.11.5 image: vmware/nginx:1.11.5-patched
container_name: nginx
restart: always restart: always
volumes: volumes:
- ../common/config/nginx:/etc/nginx - ./common/config/nginx:/etc/nginx:z
networks:
- harbor
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
- 4443:4443
depends_on: depends_on:
- mysql - mysql
- registry - registry
@ -116,3 +138,6 @@ services:
options: options:
syslog-address: "tcp://127.0.0.1:1514" syslog-address: "tcp://127.0.0.1:1514"
tag: "proxy" tag: "proxy"
networks:
harbor:
external: false

View File

@ -7,14 +7,13 @@ WORKDIR /go/src/github.com/vmware/harbor/src/ui
RUN go build -v -a -o /go/bin/harbor_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/views /go/bin/views
COPY src/ui/static /go/bin/static COPY src/ui/static /go/bin/static
COPY src/favicon.ico /go/bin/favicon.ico 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 RUN chmod u+x /go/bin/harbor_ui
WORKDIR /go/bin/ WORKDIR /go/bin/

View File

@ -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