From 158550a02abeb7ab6ba79f05f6f9f09855c21130 Mon Sep 17 00:00:00 2001 From: yhua Date: Fri, 4 Nov 2016 15:25:06 +0800 Subject: [PATCH] change some describe in docs/compile_guide.md and fix one makefile issue --- Makefile | 12 +++++++----- docs/compile_guide.md | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index f6bf71645..30286c916 100644 --- a/Makefile +++ b/Makefile @@ -243,7 +243,8 @@ package_online: modify_composefile @cp LICENSE $(HARBORPKG)/LICENSE @cp NOTICE $(HARBORPKG)/NOTICE @$(TARCMD) -zcvf harbor-online-installer-$(VERSIONTAG).tgz \ - --exclude=$(HARBORPKG)/common/db --exclude=$(HARBORPKG)/ubuntu \ + --exclude=$(HARBORPKG)/common/db \ + --exclude=$(HARBORPKG)/common/log --exclude=$(HARBORPKG)/ubuntu \ --exclude=$(HARBORPKG)/photon --exclude=$(HARBORPKG)/kubernetes \ --exclude=$(HARBORPKG)/dev --exclude=$(DOCKERCOMPOSETPLFILENAME) \ --exclude=$(HARBORPKG)/checkenv.sh \ @@ -263,7 +264,7 @@ package_offline: compile build modify_composefile @echo "pulling nginx and registry..." @$(DOCKERPULL) registry:2.5.0 - @$(DOCKERPULL) nginx:1.9 + @$(DOCKERPULL) nginx:1.11.5 @echo "saving harbor docker image" @$(DOCKERSAVE) -o $(HARBORPKG)/$(DOCKERIMGFILE).$(VERSIONTAG).tgz \ @@ -271,10 +272,11 @@ package_offline: compile build modify_composefile $(DOCKERIMAGENAME_LOG):$(VERSIONTAG) \ $(DOCKERIMAGENAME_DB):$(VERSIONTAG) \ $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) \ - nginx:1.9 registry:2.5.0 + nginx:1.11.5 registry:2.5.0 @$(TARCMD) -zcvf harbor-offline-installer-$(VERSIONTAG).tgz \ - --exclude=$(HARBORPKG)/common/db --exclude=$(HARBORPKG)/ubuntu \ + --exclude=$(HARBORPKG)/common/db \ + --exclude=$(HARBORPKG)/common/log --exclude=$(HARBORPKG)/ubuntu \ --exclude=$(HARBORPKG)/photon --exclude=$(HARBORPKG)/kubernetes \ --exclude=$(HARBORPKG)/dev --exclude=$(DOCKERCOMPOSETPLFILENAME) \ --exclude=$(HARBORPKG)/checkenv.sh \ @@ -329,7 +331,7 @@ cleanimage: - $(DOCKERRMIMAGE) -f $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) - $(DOCKERRMIMAGE) -f $(DOCKERIMAGENAME_LOG):$(VERSIONTAG) # - $(DOCKERRMIMAGE) -f registry:2.5.0 -# - $(DOCKERRMIMAGE) -f nginx:1.9 +# - $(DOCKERRMIMAGE) -f nginx:1.11.5 cleandockercomposefile: @echo "cleaning $(DOCKERCOMPOSEFILEPATH)/docker-compose.yml" diff --git a/docs/compile_guide.md b/docs/compile_guide.md index 1fac4e368..a05bdac60 100644 --- a/docs/compile_guide.md +++ b/docs/compile_guide.md @@ -1,9 +1,10 @@ ## Introduction -This is one the essential and important task of compile Harbor sourcecode for developer. Many time compiling source code files can be tedious, especially when you have to include several steps and type the compiling command everytime. Or even you can write your own Harbor code. Well, we have new method for you, here's a quick guide about how to compile binary and build container from Harbor source code. +This guide shows how to compile binary, build images and install Harbor instance from source code via make commands. ## Step 1: Prepare Your System for Building Harbor -By default, OS system does not come with the tools required. You need to install the package build-essential for making the package and checkinstall for putting it into your package manager. These can be found on the install CD or in the repositories, searching in Package Manager Software or the command-line installer. + +Harbor is deployed as several Docker containers and most of the code compiled by go language. The target host requires Python, Docker, Docker Compose and golang develop environment to be installed. Requirement: @@ -11,6 +12,7 @@ Software | Required Version ----------------------|-------------------------- docker | 1.10.0 + docker-compose | 1.7.1 + +python | 2.7 + git | 1.9.1 + make | 3.81 + golang* | 1.6.0 + @@ -24,9 +26,9 @@ golang* | 1.6.0 + ``` ## Step 3: Resolving Dependencies -Compile Harbor source code need LDAP develop package and you'll have to do it manually. +Compile Harbor source code by local golang environment needs LDAP develop package and you'll have to do it manually. If you want to compile source code by golang image, can skip this section. -For Photon: +For PhotonOS: ```sh $ tdnf install -y sed apr-util-ldap @@ -38,7 +40,7 @@ For Ubuntu: $ apt-get update && apt-get install -y libldap2-dev ``` -Other platforms please consult the relevant documentation for LDAP package install. +Other platforms please consult the relevant documentation for LDAP package installation. ## Step 4: Build and Install @@ -105,7 +107,7 @@ Support 3 code compile method: golang image compile, local golang compile and de ### Install Success -You can get this message from shell when successful complete Harbor installs. +You can get this message from shell after successful complete Harbor installs. ```sh ... @@ -114,6 +116,7 @@ You can get this message from shell when successful complete Harbor installs. 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 info. ## Attachments @@ -145,7 +148,7 @@ compile_jobservice | compile jobservice binary build | build Harbor docker images (defuault | build_photon) build_photon | build Harbor docker images from photon bsaeimage build_ubuntu | build Harbor docker images from ubuntu baseimage -install | include compile binarys, build images, prepare specific version composefile and startup Harbor instance +install | compile binarys, build images, prepare specific version composefile and startup Harbor instance start | startup Harbor instance down | shutdown Harbor instance package_online | prepare online install package @@ -155,7 +158,7 @@ clean all | remove binary, Harbor images, specific version docker-comp cleanbinary | remove ui and jobservice binary cleanimage | remove Harbor images cleandockercomposefile | remove specific version docker-compose -cleanversiontag | cleanpackageremove specific version tag +cleanversiontag | remove specific version tag cleanpackage | remove online/offline install package #### EXAMPLE: @@ -181,7 +184,7 @@ cleanpackage | remove online/offline install package ``` - note**: need add "/" on end of REGISTRYSERVER. If not setting this value will push images directly to dockerhub. + note**: need add "/" on end of REGISTRYSERVER. If not setting REGISTRYSERVER will push images directly to dockerhub. ```sh @@ -195,7 +198,7 @@ cleanpackage | remove online/offline install package $ make clean -e VERSIONTAG=[TAG] ``` - note**: If commit new code to github, the git commit TAG will change. Better use this commond clean previous images and files with specific TAG. + note**: If commit new code to github, the git commit TAG will change. Better use this command clean previous images and files for specific TAG. #### By default DEVFLAG=true, if you want to release new version of Harbor, should setting the flag to false.