mirror of
https://github.com/goharbor/harbor
synced 2025-04-30 01:47:34 +00:00
remove openldap lib from Dockerfile and support build with offcial golang image(1.7.3)
This commit is contained in:
parent
160e22f0fe
commit
4c213a8717
12
Makefile
12
Makefile
@ -5,14 +5,11 @@
|
|||||||
# all: prepare env, compile binarys, build images and install images
|
# all: prepare env, compile binarys, build images and install images
|
||||||
# prepare: prepare env
|
# prepare: prepare env
|
||||||
# compile: compile ui and jobservice code
|
# 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_golangimage:
|
||||||
# compile from golang image
|
# compile from golang image
|
||||||
# for example: make compile_golangimage -e GOBUILDIMAGE= \
|
# for example: make compile_golangimage -e GOBUILDIMAGE= \
|
||||||
# harborgo:1.6.2
|
# golang:1.7.3
|
||||||
# compile_ui, compile_jobservice: compile specific binary
|
# compile_ui, compile_jobservice: compile specific binary
|
||||||
#
|
#
|
||||||
# build: build Harbor docker images (defuault: build_photon)
|
# build: build Harbor docker images (defuault: build_photon)
|
||||||
@ -192,11 +189,6 @@ compile_jobservice:
|
|||||||
|
|
||||||
compile_normal: compile_ui 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:
|
compile_golangimage:
|
||||||
@echo "compiling binary for ui (golang image)..."
|
@echo "compiling binary for ui (golang image)..."
|
||||||
@echo $(GOBASEPATH)
|
@echo $(GOBASEPATH)
|
||||||
|
@ -24,26 +24,7 @@ golang* | 1.6.0 +
|
|||||||
$ git clone https://github.com/vmware/harbor
|
$ git clone https://github.com/vmware/harbor
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 3: Resolving dependencies of Go language
|
## Step 3: Building and installing Harbor
|
||||||
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
|
|
||||||
|
|
||||||
### Configuration
|
### 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:
|
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
|
```sh
|
||||||
$ make compile_buildgolangimage -e GOBUILDIMAGE=harborgo:1.7.3
|
$ docker pull golang:1.7.3
|
||||||
```
|
```
|
||||||
|
|
||||||
* Build, install and bring up Harbor:
|
* Build, install and bring up Harbor:
|
||||||
|
|
||||||
```sh
|
```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
|
#### 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
|
all | prepare env, compile binaries, build images and install images
|
||||||
prepare | prepare env
|
prepare | prepare env
|
||||||
compile | compile ui and jobservice code
|
compile | compile ui and jobservice code
|
||||||
compile_golangimage | compile local golang image
|
|
||||||
compile_ui | compile ui binary
|
compile_ui | compile ui binary
|
||||||
compile_jobservice | compile jobservice binary
|
compile_jobservice | compile jobservice binary
|
||||||
build | build Harbor docker images (default: using build_photon)
|
build | build Harbor docker images (default: using build_photon)
|
||||||
@ -163,13 +143,6 @@ cleanpackage | remove online/offline install package
|
|||||||
|
|
||||||
#### EXAMPLE:
|
#### EXAMPLE:
|
||||||
|
|
||||||
#### Build a golang dev image (for building Harbor):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ make compile_golangimage -e GOBUILDIMAGE= [$YOURIMAGE]
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Build Harbor images based on Ubuntu
|
#### Build Harbor images based on Ubuntu
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -2,10 +2,6 @@ FROM golang:1.7.3
|
|||||||
|
|
||||||
MAINTAINER jiangd@vmware.com
|
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
|
COPY . /go/src/github.com/vmware/harbor
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/vmware/harbor/src/jobservice
|
WORKDIR /go/src/github.com/vmware/harbor/src/jobservice
|
||||||
|
@ -2,10 +2,6 @@ FROM golang:1.7.3
|
|||||||
|
|
||||||
MAINTAINER jiangd@vmware.com
|
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
|
COPY src/. /go/src/github.com/vmware/harbor/src
|
||||||
WORKDIR /go/src/github.com/vmware/harbor/src/ui
|
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
|
COPY make/jsminify.sh /tmp/jsminify.sh
|
||||||
|
|
||||||
RUN chmod u+x /go/bin/harbor_ui \
|
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'` \
|
&& 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/ \
|
&& /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
|
&& sed -i "s/harbor\.app\.min\.js/harbor\.app\.min\.$timestamp\.js/g" /go/bin/views/sections/script-min-include.htm
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM library/photon:1.0
|
FROM library/photon:1.0
|
||||||
|
|
||||||
RUN mkdir /harbor/
|
RUN mkdir /harbor/
|
||||||
RUN tdnf install -y sed apr-util-ldap
|
RUN tdnf install -y sed
|
||||||
|
|
||||||
COPY ./make/dev/ui/harbor_ui /harbor/
|
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 \
|
RUN chmod u+x /harbor/harbor_ui \
|
||||||
&& timestamp=`date '+%s'` \
|
&& timestamp=`date '+%s'` \
|
||||||
&& /tmp/jsminify.sh /harbor/views/sections/script-include.htm /harbor/static/resources/js/harbor.app.min.$timestamp.js /harbor/ \
|
&& /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 \
|
&& 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
|
|
||||||
|
|
||||||
WORKDIR /harbor/
|
WORKDIR /harbor/
|
||||||
ENTRYPOINT ["/harbor/harbor_ui"]
|
ENTRYPOINT ["/harbor/harbor_ui"]
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
FROM golang:1.7.3
|
FROM library/ubuntu:14.04
|
||||||
|
|
||||||
MAINTAINER jiangd@vmware.com
|
MAINTAINER jiangd@vmware.com
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y libldap2-dev \
|
|
||||||
&& rm -r /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN mkdir /harbor/
|
RUN mkdir /harbor/
|
||||||
COPY ./make/dev/jobservice/harbor_jobservice /harbor/
|
COPY ./make/dev/jobservice/harbor_jobservice /harbor/
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
FROM golang:1.7.3
|
FROM library/ubuntu:14.04
|
||||||
|
|
||||||
MAINTAINER jiangd@vmware.com
|
MAINTAINER jiangd@vmware.com
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y libldap2-dev \
|
|
||||||
&& rm -r /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ENV MYSQL_USR root \
|
ENV MYSQL_USR root \
|
||||||
MYSQL_PWD root \
|
MYSQL_PWD root \
|
||||||
REGISTRY_URL localhost:5000
|
REGISTRY_URL localhost:5000
|
||||||
@ -18,8 +15,6 @@ COPY ./src/favicon.ico /harbor/favicon.ico
|
|||||||
COPY ./make/jsminify.sh /tmp/jsminify.sh
|
COPY ./make/jsminify.sh /tmp/jsminify.sh
|
||||||
|
|
||||||
RUN chmod u+x /harbor/harbor_ui \
|
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'` \
|
&& timestamp=`date '+%s'` \
|
||||||
&& /tmp/jsminify.sh /harbor/views/sections/script-include.htm /harbor/static/resources/js/harbor.app.min.$timestamp.js /harbor/ \
|
&& /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
|
&& sed -i "s/harbor\.app\.min\.js/harbor\.app\.min\.$timestamp\.js/g" /harbor/views/sections/script-min-include.htm
|
||||||
|
@ -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/*
|
|
Loading…
x
Reference in New Issue
Block a user