diff --git a/Makefile b/Makefile index d6c7d442a..974118b9c 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,11 @@ # all: prepare env, compile binarys, build images and install images # prepare: prepare env # compile: compile ui and jobservice code -# compile_buildgolangimage: -# compile local building golang image -# forexample : make compile_buildgolangimage -e \ -# GOBUILDIMAGE=harborgo:1.6.2 +# # compile_golangimage: # compile from golang image # for example: make compile_golangimage -e GOBUILDIMAGE= \ -# harborgo:1.6.2 +# golang:1.7.3 # compile_ui, compile_jobservice: compile specific binary # # build: build Harbor docker images (defuault: build_photon) @@ -192,11 +189,6 @@ compile_jobservice: compile_normal: compile_ui compile_jobservice -compile_buildgolangimage: - @echo "compiling golang image for harbor ..." - @$(DOCKERBUILD) -t $(GOBUILDIMAGE) -f $(TOOLSPATH)/$(GOLANGDOCKERFILENAME) . - @echo "Done." - compile_golangimage: @echo "compiling binary for ui (golang image)..." @echo $(GOBASEPATH) diff --git a/docs/compile_guide.md b/docs/compile_guide.md index 39530e3d6..76a973647 100644 --- a/docs/compile_guide.md +++ b/docs/compile_guide.md @@ -24,26 +24,7 @@ golang* | 1.6.0 + $ git clone https://github.com/vmware/harbor ``` -## Step 3: Resolving dependencies of Go language -You can compile the source code by using a Golang dev image. In this case, you can skip this step. - -If you are building Harbor using your own Go compiling environment. You need to install LDAP packages manually. - -For PhotonOS: - - ```sh - $ tdnf install -y sed apr-util-ldap - ``` - -For Ubuntu: - - ```sh - $ apt-get update && apt-get install -y libldap2-dev - ``` - -For other platforms, please consult the relevant documentation of installing LDAP package. - -## Step 4: Building and installing Harbor +## Step 3: Building and installing Harbor ### Configuration @@ -58,18 +39,18 @@ Edit the file **make/harbor.cfg** and make necessary configuration changes such You can compile the code by one of the three approaches: -#### I. Create a Golang dev image, then build Harbor +#### I. Build with offical Golang image -* Build Golang dev image: +* Get offcial Golang image from docker hub: ```sh - $ make compile_buildgolangimage -e GOBUILDIMAGE=harborgo:1.7.3 + $ docker pull golang:1.7.3 ``` * Build, install and bring up Harbor: ```sh - $ make install -e GOBUILDIMAGE=harborgo:1.7.3 COMPILETAG=compile_golangimage + $ make install -e GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage ``` #### II. Compile code with your own Golang environment, then build Harbor @@ -142,7 +123,6 @@ Target | Description all | prepare env, compile binaries, build images and install images prepare | prepare env compile | compile ui and jobservice code -compile_golangimage | compile local golang image compile_ui | compile ui binary compile_jobservice | compile jobservice binary build | build Harbor docker images (default: using build_photon) @@ -163,13 +143,6 @@ cleanpackage | remove online/offline install package #### EXAMPLE: -#### Build a golang dev image (for building Harbor): - - ```sh - $ make compile_golangimage -e GOBUILDIMAGE= [$YOURIMAGE] - - ``` - #### Build Harbor images based on Ubuntu ```sh diff --git a/make/dev/jobservice/Dockerfile b/make/dev/jobservice/Dockerfile index 8cd8467e1..87bc159fb 100644 --- a/make/dev/jobservice/Dockerfile +++ b/make/dev/jobservice/Dockerfile @@ -2,10 +2,6 @@ FROM golang:1.7.3 MAINTAINER jiangd@vmware.com -RUN apt-get update \ - && apt-get install -y libldap2-dev \ - && rm -r /var/lib/apt/lists/* - COPY . /go/src/github.com/vmware/harbor WORKDIR /go/src/github.com/vmware/harbor/src/jobservice diff --git a/make/dev/ui/Dockerfile b/make/dev/ui/Dockerfile index 1f7fb2fb2..db2f0aa04 100644 --- a/make/dev/ui/Dockerfile +++ b/make/dev/ui/Dockerfile @@ -2,10 +2,6 @@ FROM golang:1.7.3 MAINTAINER jiangd@vmware.com -RUN apt-get update \ - && apt-get install -y libldap2-dev \ - && rm -r /var/lib/apt/lists/* - COPY src/. /go/src/github.com/vmware/harbor/src WORKDIR /go/src/github.com/vmware/harbor/src/ui @@ -21,8 +17,6 @@ COPY src/favicon.ico /go/bin/favicon.ico COPY make/jsminify.sh /tmp/jsminify.sh RUN chmod u+x /go/bin/harbor_ui \ - && sed -i 's/TLS_CACERT/#TLS_CACERT/g' /etc/ldap/ldap.conf \ - && sed -i '$a\TLS_REQCERT allow' /etc/ldap/ldap.conf \ && timestamp=`date '+%s'` \ && /tmp/jsminify.sh /go/bin/views/sections/script-include.htm /go/bin/static/resources/js/harbor.app.min.$timestamp.js /go/bin/ \ && sed -i "s/harbor\.app\.min\.js/harbor\.app\.min\.$timestamp\.js/g" /go/bin/views/sections/script-min-include.htm diff --git a/make/photon/ui/Dockerfile b/make/photon/ui/Dockerfile index 29722d4dc..e52164471 100644 --- a/make/photon/ui/Dockerfile +++ b/make/photon/ui/Dockerfile @@ -1,7 +1,7 @@ FROM library/photon:1.0 RUN mkdir /harbor/ -RUN tdnf install -y sed apr-util-ldap +RUN tdnf install -y sed COPY ./make/dev/ui/harbor_ui /harbor/ @@ -13,8 +13,7 @@ COPY ./make/jsminify.sh /tmp/jsminify.sh RUN chmod u+x /harbor/harbor_ui \ && timestamp=`date '+%s'` \ && /tmp/jsminify.sh /harbor/views/sections/script-include.htm /harbor/static/resources/js/harbor.app.min.$timestamp.js /harbor/ \ - && sed -i "s/harbor\.app\.min\.js/harbor\.app\.min\.$timestamp\.js/g" /harbor/views/sections/script-min-include.htm \ - && echo "TLS_REQCERT allow" >> /etc/openldap/ldap.conf + && sed -i "s/harbor\.app\.min\.js/harbor\.app\.min\.$timestamp\.js/g" /harbor/views/sections/script-min-include.htm WORKDIR /harbor/ ENTRYPOINT ["/harbor/harbor_ui"] diff --git a/make/ubuntu/jobservice/Dockerfile b/make/ubuntu/jobservice/Dockerfile index 0528c9ae4..29814703d 100644 --- a/make/ubuntu/jobservice/Dockerfile +++ b/make/ubuntu/jobservice/Dockerfile @@ -1,10 +1,7 @@ -FROM golang:1.7.3 +FROM library/ubuntu:14.04 MAINTAINER jiangd@vmware.com -RUN apt-get update && apt-get install -y libldap2-dev \ - && rm -r /var/lib/apt/lists/* - RUN mkdir /harbor/ COPY ./make/dev/jobservice/harbor_jobservice /harbor/ diff --git a/make/ubuntu/ui/Dockerfile b/make/ubuntu/ui/Dockerfile index d54749741..f44d4fdf9 100644 --- a/make/ubuntu/ui/Dockerfile +++ b/make/ubuntu/ui/Dockerfile @@ -1,10 +1,7 @@ -FROM golang:1.7.3 +FROM library/ubuntu:14.04 MAINTAINER jiangd@vmware.com -RUN apt-get update && apt-get install -y libldap2-dev \ - && rm -r /var/lib/apt/lists/* - ENV MYSQL_USR root \ MYSQL_PWD root \ REGISTRY_URL localhost:5000 @@ -18,8 +15,6 @@ COPY ./src/favicon.ico /harbor/favicon.ico COPY ./make/jsminify.sh /tmp/jsminify.sh RUN chmod u+x /harbor/harbor_ui \ - && sed -i 's/TLS_CACERT/#TLS_CACERT/g' /etc/ldap/ldap.conf \ - && sed -i '$a\TLS_REQCERT allow' /etc/ldap/ldap.conf \ && timestamp=`date '+%s'` \ && /tmp/jsminify.sh /harbor/views/sections/script-include.htm /harbor/static/resources/js/harbor.app.min.$timestamp.js /harbor/ \ && sed -i "s/harbor\.app\.min\.js/harbor\.app\.min\.$timestamp\.js/g" /harbor/views/sections/script-min-include.htm diff --git a/tools/Dockerfile.golang b/tools/Dockerfile.golang deleted file mode 100644 index ef4916388..000000000 --- a/tools/Dockerfile.golang +++ /dev/null @@ -1,5 +0,0 @@ -FROM golang:1.7.3 - -RUN apt-get update \ - && apt-get install -y libldap2-dev \ - && rm -r /var/lib/apt/lists/*