프라이빗 docker registry 서비스인 harbor 서비스를 docker로 설치하는 가이드를 작성합니다.
일반적으로 docker는 오피셜 docker hub에서 docker image를 다운로드하게 됩니다.
docker image가 배포되는 docker hub 같은 저장소를 docker registry라고 하는데
docker hub는 누구나 사용 가능한 오픈된 공간이기 때문에 회사나 개인용으로 수정된 docker image를
docker hub에 업로드해서 오픈하기에는 보안상 적합하지 않습니다.
이런 경우에 회사 업무나 개인용으로 따로 격리된 private registry 서버의 필요성이 생기는데
harbor는 그 역할을 가능하게 해주는 private registry 서버를 제공하는 서비스입니다.
본 가이드는 시놀로지 DS1019+ 에서 동작을 확인한 가이드입니다.
Tip. 가이드 작성하면서 harbor 설치해본 결과, Intel/AMD 계열에서 설치가 가능했고
OCI A1 arm64 인스턴스에서는 설치되지 않았으니, 서버 arch 환경에 대한 확인이 필요합니다.
1. harbor 다운로드 사이트에서 최신 버전 확인
2. harbor 인스톨 파일 다운로드
tip 1. 본 가이드는 현재 최신 버전인 harbor-offline-installer-v2.6.0.tgz (721MB) 파일을 기준으로 설명합니다.
설치 타입 | 링크 |
harbor-offline-installer-v2.6.0.tgz (721MB) | https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-offline-installer-v2.6.0.tgz |
harbor-online-installer-v2.6.0.tgz (10.4KB) | https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-online-installer-v2.6.0.tgz |
tip 2. 제 시놀로지 DS1019+ 에서는 wget이 ssl을 지원하지 못하여 ssh shell 상에서 바로 다운로드가 불가능합니다.
때문에 일반 윈도우 PC에서 harbor-offline-installer-v2.6.0.tgz (721MB) 파일을 다운로드한 다음에
samba로 시놀로지에 옮겨 주었습니다.
// 시놀로지 DS1019+에 설치된 wget 에서 htts 지원하지 않음 $ curl -s https://api.github.com/repos/goharbor/harbor/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep '\.tgz$' | wget -i - -: Invalid URL https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-offline-installer-v2.6.0.tgz: HTTPS support not compiled in -: Invalid URL https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-online-installer-v2.6.0.tgz: HTTPS support not compiled in No URLs found in -. $ wget --version GNU Wget 1.12 built on linux-gnu. // 구글링 해보고, wget 삭제하고 wget-ssl으로 다시 설치 $ sudo ipkg remove wget Password: Removing package wget from root... Successfully terminated. $ sudo ipkg install wget-ssl Installing wget-ssl (1.12-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/wget-ssl_1.12-2_i686.ipk Configuring wget-ssl Successfully terminated. // wget-ssl 설치하고 뭔가 더 진행됬지만, 결국 SSL 에러 발새하면서 wget으로 https 파일 다운로드 안됨 $ curl -s https://api.github.com/repos/goharbor/harbor/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep '\.tgz$' | wget -i - --2022-09-03 00:53:53-- https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-offline-installer-v2.6.0.tgz Resolving github.com (github.com)... 20.200.245.247 Connecting to github.com (github.com)|20.200.245.247|:443... connected. OpenSSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version Unable to establish SSL connection. --2022-09-03 00:53:53-- https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-online-installer-v2.6.0.tgz Connecting to github.com (github.com)|20.200.245.247|:443... connected. OpenSSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version Unable to establish SSL connection. $ wget --version GNU Wget 1.12 built on linux-gnu. |
tip 3. 시놀로지의 console이 아닌 일반 ubuntu 리눅스 환경이라면 아래 커맨드로 쉽게 다운로드 가능합니다.
- $ curl -s https://api.github.com/repos/goharbor/harbor/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep '\.tgz$' | wget -i -
// 일반 ubuntu 리눅스 환경에서는 wget으로 https 잘 다운로드 됨 $ curl -s https://api.github.com/repos/goharbor/harbor/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep '\.tgz$' | wget -i - --2022-09-03 00:50:57-- https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-offline-installer-v2.6.0.tgz Resolving github.com (github.com)... 20.200.245.247 Connecting to github.com (github.com)|20.200.245.247|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/31d45386-99bc-4f05-a7e9-a8e1dca32a9e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220902%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220902T155049Z&X-Amz-Expires=300&X-Amz-Signature=ef73cdd9e7fd9bb3def78f96fc2add316f3481927b7ef44551ab7e123e3f61c6&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=50613991&response-content-disposition=attachment%3B%20filename%3Dharbor-offline-installer-v2.6.0.tgz&response-content-type=application%2Foctet-stream [following] --2022-09-03 00:50:57-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/31d45386-99bc-4f05-a7e9-a8e1dca32a9e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220902%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220902T155049Z&X-Amz-Expires=300&X-Amz-Signature=ef73cdd9e7fd9bb3def78f96fc2add316f3481927b7ef44551ab7e123e3f61c6&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=50613991&response-content-disposition=attachment%3B%20filename%3Dharbor-offline-installer-v2.6.0.tgz&response-content-type=application%2Foctet-stream Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ... Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 756124163 (721M) [application/octet-stream] Saving to: ‘harbor-offline-installer-v2.6.0.tgz.1’ harbor-offline-installer-v2.6.0 100%[====================================================>] 721.10M 5.24MB/s in 2m 32s 2022-09-03 00:53:30 (4.73 MB/s) - ‘harbor-offline-installer-v2.6.0.tgz.1’ saved [756124163/756124163] --2022-09-03 00:53:30-- https://github.com/goharbor/harbor/releases/download/v2.6.0/harbor-online-installer-v2.6.0.tgz Connecting to github.com (github.com)|20.200.245.247|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/9d327054-8d9a-4f7e-a232-eefee1a9c721?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220902%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220902T155331Z&X-Amz-Expires=300&X-Amz-Signature=889489d6e00ff297ffba44a9720d47c9f7a46ffe437edbe5f327c6124feaf1fd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=50613991&response-content-disposition=attachment%3B%20filename%3Dharbor-online-installer-v2.6.0.tgz&response-content-type=application%2Foctet-stream [following] --2022-09-03 00:53:30-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/9d327054-8d9a-4f7e-a232-eefee1a9c721?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220902%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220902T155331Z&X-Amz-Expires=300&X-Amz-Signature=889489d6e00ff297ffba44a9720d47c9f7a46ffe437edbe5f327c6124feaf1fd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=50613991&response-content-disposition=attachment%3B%20filename%3Dharbor-online-installer-v2.6.0.tgz&response-content-type=application%2Foctet-stream Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 10687 (10K) [application/octet-stream] Saving to: ‘harbor-online-installer-v2.6.0.tgz’ harbor-online-installer-v2.6.0. 100%[====================================================>] 10.44K --.-KB/s in 0.003s 2022-09-03 00:53:31 (3.17 MB/s) - ‘harbor-online-installer-v2.6.0.tgz’ saved [10687/10687] FINISHED --2022-09-03 00:53:31-- Total wall clock time: 2m 34s Downloaded: 2 files, 721M in 2m 32s (4.73 MB/s) $ wget --version GNU Wget 1.20.3 built on linux-gnu. |
3. harbor 인스톨 파일 압축 해제
tip. 가이드는 /volume3/docker/harbor 경로에 설치하는 예시로 설명합니다.
1. 다운로드한 harbor-offline-installer-v2.6.0.tgz (721MB) 파일을 /volume3/docker 경로에 복사
- $ cd /volume3/docker
- $ tar xvf harbor-offline-installer-v2.6.0.tgz
- 압축 해제하면 harbor 디렉토리가 생성됨
- $ cd harbor
$ cd /volume3/docker // 압축 해제 되면서 harbor 디렉토리가 생성됨 $ tar xvf harbor-offline-installer-v2.6.0.tgz harbor/harbor.v2.6.0.tar.gz harbor/prepare harbor/LICENSE harbor/install.sh harbor/common.sh harbor/harbor.yml.tmpl $ cd harbor $ ls -l total 1480656 -rwxrwxrwx+ 1 test users 3639 Aug 28 13:26 common.sh drwxrwxrwx+ 1 test users 124 Sep 2 22:31 data drwxrwxrwx+ 1 test users 204 Sep 2 22:36 harbor -rwxrwxrwx+ 1 test users 756124163 Sep 2 21:48 harbor-offline-installer-v2.6.0.tgz -rwxrwxrwx+ 1 test users 10687 Sep 2 21:45 harbor-online-installer-v2.6.0.tgz -rwxrwxrwx+ 1 test users 760014737 Aug 28 13:27 harbor.v2.6.0.tar.gz -rwxrwxrwx+ 1 test users 10491 Aug 28 13:26 harbor.yml.tmpl -rwxrwxrwx+ 1 test users 3171 Aug 28 13:26 install.sh -rwxrwxrwx+ 1 test users 11347 Aug 28 13:26 LICENSE drwxrwxrwx+ 1 10000 10000 182 Sep 2 22:33 log -rwxrwxrwx+ 1 test users 1881 Aug 28 13:26 prepare |
4. harbor 환경 설정
1. 환경설정 템플릿 파일을 harbor.yml으로 복사
- $ cp harbor.yml.tmpl harbor.yml
2. 환경설정 harbor.yml 파일 수정
- $ vim harbor.yml
// hostname, port, admin 암호, DB 암호 지정 [5라인] hostname: <HOST_IP or DNS> // 예) harbor.<ID>.synology.me [10라인] port: <DOCKER_PORT> // 예) 50001 [29라인] external_url:https://<HOST_IP or DNS> // 예) https://harbor.<ID>.synology.me (NPM 설정된 외부 주소) [34라인] harbor_admin_password: <ADMIN_PASSWORD> // 예) 기본값 Harbor12345 [39라인] password: <DB_PASSWORD> // 예) 기본값 root123 [48라인] data_volume: <VOLUME_PATH_DATA> // 예) /volume3/docker/harbor/data [127라인] location: <VOLUME_PATH_LOG> // 예) /volume3/docker/harbor/log |
// https 주석 처리 (NPM으로 https 적용 예정) [13라인] #https: [15라인] # port: 443 [17라인] # certificate: /your/certificate/path [18라인] # private_key: /your/private/key/path |
5. harbor 설치
tip. docker-compose 커맨드가 설치되어 있어야 합니다.
혹시라도 docker-compose 명령이 없다면 먼저 설치해주세요. (자세한 설명 생략)
1. volunm 경로 생성 (미리 생성해 놓지 않으면 install 진행하다 error 발생하면서 멈춤)
- $ mkdir -p /volume3/docker/harbor/data
- $ mkdir -p /volume3/docker/harbor/log
- $ mkdir -p /volume3/docker/harbor/common/config
2. install.sh 실행
- $ sudo ./install.sh
$ sudo ./install.sh Password: /volume3/docker/harbor/common.sh: line 13: tput: command not found /volume3/docker/harbor/common.sh: line 14: tput: command not found /volume3/docker/harbor/common.sh: line 15: tput: command not found /volume3/docker/harbor/common.sh: line 17: tput: command not found /volume3/docker/harbor/common.sh: line 18: tput: command not found /volume3/docker/harbor/common.sh: line 19: tput: command not found /volume3/docker/harbor/common.sh: line 20: tput: command not found /volume3/docker/harbor/common.sh: line 21: tput: command not found [Step 0]: checking if docker is installed ... Note: docker version: 20.10.3 [Step 1]: checking docker-compose is installed ... Note: docker-compose version: 1.28.5 [Step 2]: loading Harbor images ... 915f79eed965: Loading layer [==================================================>] 37.77MB/37.77MB 53e17aa1994a: Loading layer [==================================================>] 8.898MB/8.898MB 82205c155ee7: Loading layer [==================================================>] 3.584kB/3.584kB 7ffa6a408e36: Loading layer [==================================================>] 2.56kB/2.56kB 1a2ed94f447f: Loading layer [==================================================>] 97.91MB/97.91MB e031eb4548cd: Loading layer [==================================================>] 98.7MB/98.7MB Loaded image: goharbor/harbor-jobservice:v2.6.0 1ddd239fd081: Loading layer [==================================================>] 5.755MB/5.755MB 51cfe17ad552: Loading layer [==================================================>] 4.096kB/4.096kB d66b11611927: Loading layer [==================================================>] 17.1MB/17.1MB 95ec06f9ede8: Loading layer [==================================================>] 3.072kB/3.072kB 4915db4c8a75: Loading layer [==================================================>] 29.13MB/29.13MB de0dd696d1e4: Loading layer [==================================================>] 47.03MB/47.03MB Loaded image: goharbor/harbor-registryctl:v2.6.0 135ff4cdf210: Loading layer [==================================================>] 119.9MB/119.9MB 971eb518f877: Loading layer [==================================================>] 3.072kB/3.072kB dca613dfbd94: Loading layer [==================================================>] 59.9kB/59.9kB 86701cd4bbd5: Loading layer [==================================================>] 61.95kB/61.95kB Loaded image: goharbor/redis-photon:v2.6.0 db777e2b34a6: Loading layer [==================================================>] 119MB/119MB Loaded image: goharbor/nginx-photon:v2.6.0 e8b623356728: Loading layer [==================================================>] 6.283MB/6.283MB de97fd65d649: Loading layer [==================================================>] 4.096kB/4.096kB 80d89e68db87: Loading layer [==================================================>] 3.072kB/3.072kB d30aaa68403a: Loading layer [==================================================>] 91.21MB/91.21MB 09c2eb3f70bf: Loading layer [==================================================>] 12.86MB/12.86MB d033d51a66ed: Loading layer [==================================================>] 104.9MB/104.9MB Loaded image: goharbor/trivy-adapter-photon:v2.6.0 d68ea3579314: Loading layer [==================================================>] 43.85MB/43.85MB ba0eac6b665d: Loading layer [==================================================>] 65.88MB/65.88MB 6e6fdfe712e6: Loading layer [==================================================>] 18.03MB/18.03MB 936f2805133b: Loading layer [==================================================>] 65.54kB/65.54kB d1cc2359b34f: Loading layer [==================================================>] 2.56kB/2.56kB 3db4c06ddde2: Loading layer [==================================================>] 1.536kB/1.536kB ffa89d14f0f8: Loading layer [==================================================>] 12.29kB/12.29kB 5b6fc339f848: Loading layer [==================================================>] 2.612MB/2.612MB bf25a672c522: Loading layer [==================================================>] 379.9kB/379.9kB Loaded image: goharbor/prepare:v2.6.0 f03402c298a4: Loading layer [==================================================>] 127.1MB/127.1MB ec437899a2d4: Loading layer [==================================================>] 3.584kB/3.584kB fc987efeff2f: Loading layer [==================================================>] 3.072kB/3.072kB ccac4ecb9fab: Loading layer [==================================================>] 2.56kB/2.56kB 76126881776b: Loading layer [==================================================>] 3.072kB/3.072kB e5710297bc49: Loading layer [==================================================>] 3.584kB/3.584kB 86ada12d4961: Loading layer [==================================================>] 20.99kB/20.99kB Loaded image: goharbor/harbor-log:v2.6.0 4a1effd4840f: Loading layer [==================================================>] 8.898MB/8.898MB 3972ad56d11c: Loading layer [==================================================>] 24.63MB/24.63MB e13ac1c66f56: Loading layer [==================================================>] 4.608kB/4.608kB b38b2979e8ca: Loading layer [==================================================>] 25.42MB/25.42MB Loaded image: goharbor/harbor-exporter:v2.6.0 1616a4b7b75d: Loading layer [==================================================>] 119MB/119MB 554400dd99a8: Loading layer [==================================================>] 7.535MB/7.535MB 6716f4e67dff: Loading layer [==================================================>] 1.185MB/1.185MB Loaded image: goharbor/harbor-portal:v2.6.0 2a50c39af894: Loading layer [==================================================>] 1.096MB/1.096MB f51c34c3ca3f: Loading layer [==================================================>] 5.888MB/5.888MB b5cc7d5afb32: Loading layer [==================================================>] 169MB/169MB e38b1eb3cd75: Loading layer [==================================================>] 16.72MB/16.72MB 8a0ad5839a99: Loading layer [==================================================>] 4.096kB/4.096kB b31920119f7b: Loading layer [==================================================>] 6.144kB/6.144kB 95588b7a97e8: Loading layer [==================================================>] 3.072kB/3.072kB 37736a8af56d: Loading layer [==================================================>] 2.048kB/2.048kB f5d998d20d26: Loading layer [==================================================>] 2.56kB/2.56kB 3665e4285a3e: Loading layer [==================================================>] 2.56kB/2.56kB 324a12cf3159: Loading layer [==================================================>] 2.56kB/2.56kB 54caba94e156: Loading layer [==================================================>] 8.704kB/8.704kB Loaded image: goharbor/harbor-db:v2.6.0 470e6e891906: Loading layer [==================================================>] 5.75MB/5.75MB 4088c7055d35: Loading layer [==================================================>] 8.718MB/8.718MB 2d362b585526: Loading layer [==================================================>] 14.47MB/14.47MB b4769e45480f: Loading layer [==================================================>] 29.29MB/29.29MB 83e39cfb4f90: Loading layer [==================================================>] 22.02kB/22.02kB 640999c19ee7: Loading layer [==================================================>] 14.47MB/14.47MB Loaded image: goharbor/notary-signer-photon:v2.6.0 85eb81bb9355: Loading layer [==================================================>] 5.755MB/5.755MB 0e885f83b805: Loading layer [==================================================>] 90.88MB/90.88MB 1a9fd2a13905: Loading layer [==================================================>] 3.072kB/3.072kB 084b31f7f0cd: Loading layer [==================================================>] 4.096kB/4.096kB 1b3ae6218261: Loading layer [==================================================>] 91.67MB/91.67MB Loaded image: goharbor/chartmuseum-photon:v2.6.0 f2f491399890: Loading layer [==================================================>] 8.898MB/8.898MB 9e8aca626b7b: Loading layer [==================================================>] 3.584kB/3.584kB 7209c3a47c64: Loading layer [==================================================>] 2.56kB/2.56kB b00a81023fca: Loading layer [==================================================>] 80.74MB/80.74MB 9a69cb50757d: Loading layer [==================================================>] 5.632kB/5.632kB 43ecb1743b7e: Loading layer [==================================================>] 105.5kB/105.5kB 209ea1fa2634: Loading layer [==================================================>] 44.03kB/44.03kB 52f401aa0ea0: Loading layer [==================================================>] 81.68MB/81.68MB d09eb77e4ec9: Loading layer [==================================================>] 2.56kB/2.56kB Loaded image: goharbor/harbor-core:v2.6.0 3c6f934a9b56: Loading layer [==================================================>] 5.755MB/5.755MB b3bb2335fb3a: Loading layer [==================================================>] 4.096kB/4.096kB 371f4a2117d4: Loading layer [==================================================>] 3.072kB/3.072kB 1b3ba34ba7db: Loading layer [==================================================>] 17.1MB/17.1MB 621e061b4f88: Loading layer [==================================================>] 17.9MB/17.9MB Loaded image: goharbor/registry-photon:v2.6.0 b8b9704ed345: Loading layer [==================================================>] 5.75MB/5.75MB 53cb970e3348: Loading layer [==================================================>] 8.718MB/8.718MB 9cb4357dfa83: Loading layer [==================================================>] 15.88MB/15.88MB ecdb7cd58026: Loading layer [==================================================>] 29.29MB/29.29MB d8e381266109: Loading layer [==================================================>] 22.02kB/22.02kB d1a45ff5c697: Loading layer [==================================================>] 15.88MB/15.88MB Loaded image: goharbor/notary-server-photon:v2.6.0 [Step 3]: preparing environment ... [Step 4]: preparing harbor configs ... prepare base dir is set to /volume3/docker/harbor WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https Generated configuration file: /config/portal/nginx.conf Generated configuration file: /config/log/logrotate.conf Generated configuration file: /config/log/rsyslog_docker.conf Generated configuration file: /config/nginx/nginx.conf Generated configuration file: /config/core/env Generated configuration file: /config/core/app.conf Generated configuration file: /config/registry/config.yml Generated configuration file: /config/registryctl/env Generated configuration file: /config/registryctl/config.yml Generated configuration file: /config/db/env Generated configuration file: /config/jobservice/env Generated configuration file: /config/jobservice/config.yml Generated and saved secret to file: /data/secret/keys/secretkey Successfully called func: create_root_cert Generated configuration file: /compose_location/docker-compose.yml Clean up the input dir Note: stopping existing Harbor instance ... Removing network harbor_harbor WARNING: Network harbor_harbor not found. [Step 5]: starting Harbor ... Creating network "harbor_harbor" with the default driver Creating harbor-log ... done Creating harbor-db ... done Creating redis ... done Creating registryctl ... done Creating harbor-portal ... done Creating registry ... done Creating harbor-core ... done Creating nginx ... done Creating harbor-jobservice ... done ✔ ----Harbor has been installed and started successfully.---- |
2. harbor 컨테이너 동작 확인
- $ sudo docker-compose ps
// 정상인 경우 = 모두 다 Up (health) 인지 확인 $ sudo docker-compose ps Name Command State Ports --------------------------------------------------------------------------------------------- harbor-core /harbor/entrypoint.sh Up (healthy) harbor-db /docker-entrypoint.sh 96 13 Up (healthy) harbor-jobservice /harbor/entrypoint.sh Up (healthy) harbor-log /bin/sh -c /usr/local/bin/ ... Up (healthy) 127.0.0.1:1514->10514/tcp harbor-portal nginx -g daemon off; Up (healthy) nginx nginx -g daemon off; Up (healthy) 0.0.0.0:11115->8080/tcp redis redis-server /etc/redis.conf Up (healthy) registry /home/harbor/entrypoint.sh Up (healthy) registryctl /home/harbor/start.sh Up (healthy) |
tip. 만약 docker-compose ps로 확인한 harbor 서비스 중에 Restarting 뜨는 항목이 있다면
sudo docker-compose down으로 삭제하고, 다시 sudo ./install.sh 으 재설치해보세요.
(가이드를 작성하려고 2-3번 설치하는 과정에서 저도 한번 발생한 증상이라 tip으로 남겨둡니다.)
// 문제있는 경우 = 모두 다 Up (headlth)가 아닌 경우... $ sudo docker-compose ps Name Command State Ports ------------------------------------------------------------------------------------------------------ harbor-core /harbor/entrypoint.sh Up (health: starting) harbor-db /docker-entrypoint.sh 96 13 Restarting harbor-jobservice /harbor/entrypoint.sh Restarting harbor-log /bin/sh -c /usr/local/bin/ ... Up (healthy) 127.0.0.1:1514->10514/tcp harbor-portal nginx -g daemon off; Up (healthy) nginx nginx -g daemon off; Up (healthy) 0.0.0.0:11115->8080/tcp redis redis-server /etc/redis.conf Up (healthy) registry /home/harbor/entrypoint.sh Up (healthy) registryctl /home/harbor/start.sh Up (healthy) $ sudo docker-compose down Stopping registryctl ... done Stopping harbor-log ... done Removing harbor-jobservice ... done Removing nginx ... done Removing harbor-core ... done Removing registry ... done Removing harbor-portal ... done Removing registryctl ... done Removing redis ... done Removing harbor-db ... done Removing harbor-log ... done Removing network harbor_harbor $ sudo ./install.sh (생략) // 다시 ps 명령으로 모두 다 Up (health) 인지 확인 $ sudo docker-compose ps Name Command State Ports --------------------------------------------------------------------------------------------- harbor-core /harbor/entrypoint.sh Up (healthy) harbor-db /docker-entrypoint.sh 96 13 Up (healthy) harbor-jobservice /harbor/entrypoint.sh Up (healthy) harbor-log /bin/sh -c /usr/local/bin/ ... Up (healthy) 127.0.0.1:1514->10514/tcp harbor-portal nginx -g daemon off; Up (healthy) nginx nginx -g daemon off; Up (healthy) 0.0.0.0:11115->8080/tcp redis redis-server /etc/redis.conf Up (healthy) registry /home/harbor/entrypoint.sh Up (healthy) registryctl /home/harbor/start.sh Up (healthy) |
Tip. 설치한 harbor를 삭제하고 싶다면...
- $ sudo docker-compose down
$ sudo docker-compose down Stopping nginx ... done Stopping harbor-jobservice ... done Stopping harbor-core ... done Stopping registryctl ... done Stopping registry ... done Stopping harbor-portal ... done Stopping redis ... done Stopping harbor-db ... done Stopping harbor-log ... done Removing nginx ... done Removing harbor-jobservice ... done Removing harbor-core ... done Removing registryctl ... done Removing registry ... done Removing harbor-portal ... done Removing redis ... done Removing harbor-db ... done Removing harbor-log ... done Removing network harbor_harbor // docker image 까지 삭제하고 싶다면, harbor로 검색해서 $ sudo docker images | grep harbor goharbor/harbor-exporter v2.6.0 abb2f54ff016 5 days ago 94.5MB goharbor/chartmuseum-photon v2.6.0 bd0057522e24 5 days ago 225MB goharbor/redis-photon v2.6.0 39f3ba8729b9 5 days ago 155MB goharbor/trivy-adapter-photon v2.6.0 f0bfdaf83591 5 days ago 252MB goharbor/notary-server-photon v2.6.0 e9470194b316 5 days ago 112MB goharbor/notary-signer-photon v2.6.0 2cfb256ff549 5 days ago 110MB goharbor/harbor-registryctl v2.6.0 0a1f09b3dace 5 days ago 136MB goharbor/registry-photon v2.6.0 76aee5aa231c 5 days ago 77.6MB goharbor/nginx-photon v2.6.0 e35e9e75dc24 5 days ago 154MB goharbor/harbor-log v2.6.0 f1f66d3421be 5 days ago 161MB goharbor/harbor-jobservice v2.6.0 c28d745f640d 5 days ago 241MB goharbor/harbor-core v2.6.0 538081eb14b9 5 days ago 207MB goharbor/harbor-portal v2.6.0 92ef4c829298 5 days ago 162MB goharbor/harbor-db v2.6.0 4892019f0afc 5 days ago 225MB goharbor/prepare v2.6.0 85d28ac66ab1 5 days ago 163MB // 검색된 IMAGE ID를 모두 삭제하기 $ sudo docker image rm 85d28ac66ab1 4892019f0afc 92ef4c829298 538081eb14b9 c28d745f640d f1f66d3421be e35e9e75dc24 76aee5aa231c 0a1f09b3dace 2cfb256ff549 e9470194b316 f0bfdaf83591 39f3ba8729b9 bd0057522e24 abb2f54ff016 Untagged: goharbor/prepare:v2.6.0 Deleted: sha256:85d28ac66ab1df9d9f22e63aa4dbe46107227550a7a1ba696497b1fb11cd041a Deleted: sha256:b9b1bf399c08684167d19197c378571977f11b69fff3dc05cde2b12952711a54 Deleted: sha256:519c8f9fe5b18c2f0de15a4788ddab471d1dbd227550044da4d5ad83c65e2c8d Deleted: sha256:d9c0db83ff40bccf68287da795fdae7128f713b7086c4eef5d674fdab9800914 Deleted: sha256:8939347f1b3e778de12b4f95c97c0d6cfa8d1ee5f756fc3cecf18dd43e90e450 Deleted: sha256:ac285f7df432b73b945f53a8edffd91580c37eb600c92de4e51f599ca3ac8946 Deleted: sha256:cf38140615e3d39f721d93cce49d7bc7ddbaf00cac0124700681bf506d6c7eca Deleted: sha256:3ac29ad56c88a56b5adaae726cc88c2092af888333e3b380894b0f2c5803feab Deleted: sha256:3a753f0fc7bf408d925b9791cc50d5e812f90b07be6b41738fc922a3366ae848 Deleted: sha256:2656e76edb2fa02a7c7f100cefa2fe04807dc2f0b86531ee4090ccedf9d3310e Untagged: goharbor/harbor-db:v2.6.0 Untagged: goharbor/harbor-db@sha256:b7057aba5dc106cefbe4be1504093310ca1bd5ad307d3255e5eb6b0e5612d24d Deleted: sha256:4892019f0afcf4fd8cb86d1021529b942794d9cec4e11761a303569018dbaa54 Deleted: sha256:24d2711a602bfd93ecfa3111e46bcf9796f3500f3019ad6705045a5254b7262e Deleted: sha256:b3335da2ba50374af659190dda146d688bda77735aeda34718a69242ef28820b Deleted: sha256:4cda7a6f24eb842e04bd63c553ee423ab044a4d011bfe1a812f2b00e8dd0eff0 Deleted: sha256:563558e7b7d0b9dd26ec12bf78edbb5c4dae9e90761a2aef0cd4cacf226ca8b4 Deleted: sha256:5492d81abbc314399db0317c10845b85462a2d31dce8e73e445eb346c815a3c7 Deleted: sha256:9359b42643d283f4bfbfb0918178a01d749ca3da0520eac554c3fe579d722a37 Deleted: sha256:b26d0aae53b5db94449dbd0dd9a377b56477359130428463353539a585e64a17 Deleted: sha256:90107b459de43a034d4baaa49cccd0920140f334bfe2122642af9f38464adfa9 Deleted: sha256:6f012102edc74147d04ae74d6c58292a60d551fd56fae2ade92d805d71254893 Deleted: sha256:2b67db7ded21a42496294b9826ccb0c17a8f19a992432f9ee5b46c3adb770afb Deleted: sha256:8397350ad3f3d26476dc74eec708fb560ee717418909954e6d5e7bb8f6e2c044 Deleted: sha256:3692ff79b5355ebecf83b963dc364e75ca9cc059ae00c75be917eaba5ca23e63 Untagged: goharbor/harbor-portal:v2.6.0 Untagged: goharbor/harbor-portal@sha256:4699307073cf5ba8e0f346e2956354cde75f474d2d44b5f22d14ae2e8f4b094e Deleted: sha256:92ef4c82929808aabbe8471100d0e2e4631968dddadd45606dc8b9aacbe75ccb Deleted: sha256:350c892fd5999b68b79107f0de24d4ab54c5cda1952539cbff31f37f156f30c1 Deleted: sha256:763bc5dc93f08523bf551624c6ae5c6b86ab3fe3ef8ff39bf2f63cac51f54024 Deleted: sha256:4f945da2452c219397b92174e9e401c697c8740f570734766cb26ee062857c28 Untagged: goharbor/harbor-core:v2.6.0 Untagged: goharbor/harbor-core@sha256:2f8c6f136606ba736db0673a5acab19ed61ada618e58453267eb0f4bc6b79f18 Deleted: sha256:538081eb14b95c1e606fceccf1a3f93d93f01ac90be950260e8ccd78c39dd2c6 Deleted: sha256:f857b9c7ad7b8d4572ba0f4fc4fb643786bbfc538971b7139e51aa14ca9c9e0a Deleted: sha256:dfd16a11d14b240a1501414f58c2ae174a9d4b75450a3783d6849164542878aa Deleted: sha256:211521d20747b255b48d97ec326fa829fa25904f98d250a8ef0c34961f7260d3 Deleted: sha256:0736dd30fe433073048213b3e35bb0f007182cc080190d92a8a760cbd9a4c703 Deleted: sha256:94b26cdb4bb3c12c1b31e9e46f1cf234ac9d4f20fb013dd7c5d4ae58c0e7dbf8 Deleted: sha256:2f7c10f36521e0e19aa61b2f16edffe6432485fe7fe3b24d086f23511ba7adcf Deleted: sha256:ce568616b7e78aae32138d72c77bdf92a5cd4adc6d3090df68c5e29665656da6 Deleted: sha256:058b8f76980bca0eff7cbaa30d92d218894e51f324e71f5d7bba33f74e3a30b2 Deleted: sha256:1fa42311ab9e39067180845eafd7dfdccd9166495e0af4f517de172b4022f55e Untagged: goharbor/harbor-jobservice:v2.6.0 Untagged: goharbor/harbor-jobservice@sha256:3203cd019ece531d241914b8804279a45fe5e1049c856b7099742a246aa905cf Deleted: sha256:c28d745f640d53fe491d0107fd2dcd8efc0fbf9eac79bde49f62c9e9a08a166f Deleted: sha256:0061fc641857b58e5412392142bf30185cdd2028e08177817de2b1218f79f295 Deleted: sha256:0deb56e3a70cbfe18f3cef3e795336b6794bc7f2267892bf19d7a181a6bdc7f1 Deleted: sha256:66af281bb4e4ac4d4684453910506e1c925184b174fae8cdd8325263e6349f00 Deleted: sha256:01d05019a2ba1b1d5320e37d53295ca32c621ed41213450882575ab2d13c274d Deleted: sha256:614ea8c5d9d418a20dff758fa4219c2361dbf45182078bc643ede593b7dc8999 Untagged: goharbor/harbor-log:v2.6.0 Untagged: goharbor/harbor-log@sha256:1f0d06a1f32a1faeebefb4dd60f09a24235e868ae96e4f40dce25bb8cc135ca6 Deleted: sha256:f1f66d3421bea04b0c10f845b312e7da9ada4b7c40fdde6d5208da9c74e637ce Deleted: sha256:0dff7576f0dfa166286105d8511678ce72028ac51af6b42782fb5295d53f11ea Deleted: sha256:17d149da5d6a036a3c03f30ffd947e76c833b3dadc0c8db653fad6edcaf8f05d Deleted: sha256:5d4cfdc6391980cf57996af6be800ed8ad6a9a6e9f6cb9a0f1fa8ae5d3d44ced Deleted: sha256:56aa29f83ce26d8b288cf17f4f911cb11761fcbb09703d5efde85f0fac356b4c Deleted: sha256:a03c0573aefcd573dc4a2cf57d1d2a0c0be064a47793f502f6c14943cdc5ddc4 Deleted: sha256:d98f291f2ae0f003b9ce1b9c246e7f2d7af041490842d5a7dc3ee8edc847dab0 Deleted: sha256:174b0ae9a83c6918ecf4af9fa895493fe4e1744f439301cf287b18061f517f8c Untagged: goharbor/nginx-photon:v2.6.0 Untagged: goharbor/nginx-photon@sha256:fb9732ddab6a08fce5dc82939682f08c0b107db584a3331cf31daef29524b67f Deleted: sha256:e35e9e75dc24f640a3f16b41475bd78b54670f13806ebc6e055b974df1926214 Deleted: sha256:d8f7366fe4ee7f0caa92b46f2579c66e5a4aeda4b974152cf1f548fc5d266ca3 Untagged: goharbor/registry-photon:v2.6.0 Untagged: goharbor/registry-photon@sha256:2c26cc0f50613cad4a5da076c752682e40a98c47aa0a90af15592f512ecb4261 Deleted: sha256:76aee5aa231cb7ee26cb72866bbbe577d9a698ce2812fe377ee512a35baa27f5 Deleted: sha256:1632938c4778f0281ad4b28be8935c782efd6e8dbecf2e551b7de5c0b1d8ea33 Deleted: sha256:19fbefc62e97f1e7e493771abfb4a4852dcda92ba8ee863a0ea457e11f0cd082 Deleted: sha256:0ceb08c53a932edb3851e0a288a3c976a22b057579c88e5ffad9045f5d2ce217 Deleted: sha256:56115bdc555bc3296d0b5a4716018e6eae0f552e569f269920ff6028bc5854d9 Deleted: sha256:c9876a3f201abc4d3c14b8d368c149d1b1a5c76c655fc1b901e4f81d135c75f3 Untagged: goharbor/harbor-registryctl:v2.6.0 Untagged: goharbor/harbor-registryctl@sha256:6683525f6a7c243be670f366199fd15745680dfe637eb1f55b643f27296bf706 Deleted: sha256:0a1f09b3daceaa94d089d6065172739c326a3ef91bf72f6953971a0cc6b2f38c Deleted: sha256:3235a33775842fafd4758828c4980d4c967e225320750fc3c79f80fcd0921f74 Deleted: sha256:8feb36930ca9649b12e2022c796cf49cc23c531de44efdf21b006d79b3d5170d Deleted: sha256:b24001303eb86a20c444cc737604f0b7f575bb9c93f040415113f79521f12456 Deleted: sha256:a5dc0fc6c29c1efbfc5942ff650d6e32361b95da310f595396cfbcd4685822d5 Deleted: sha256:306f37d1ea88b63b9680a65385e7ed4cdf31cbb4ea1338ab3e26060d83b0fcfc Deleted: sha256:fcb20808d53723a3a836e1a74b2eae4800dc68518df689be458c2f6a22ed4a51 Untagged: goharbor/notary-signer-photon:v2.6.0 Deleted: sha256:2cfb256ff5497e11d9cb47b3a25a86cabeb5b0921bcf309c8925baf45c91d1ae Deleted: sha256:4aadee991c38cc2898436aa1ec036e519aee2494721dafe0b3f0a6cb10b8f944 Deleted: sha256:de7f7332c2a21e1d778183da8274e0ab7685f48a1ab00995741e549a2e6efd56 Deleted: sha256:23aa05454a3c6a507cec17f143329038961350c0c06c72f5a70a262bf2d2500e Deleted: sha256:72add8ff8188c20beaf263c08ed49ee41534c990c054434cec92352c59269ab0 Deleted: sha256:88814680097264ce0e2702828d75802a082e0fc0acd5700b2090df1883f515e3 Deleted: sha256:6e01ff2c0bb1abefdc1b30805c3a827e4d3c1093787ee17fc658a4490af9c0a1 Untagged: goharbor/notary-server-photon:v2.6.0 Deleted: sha256:e9470194b316ca0d63f22172ecb793a863e240228fe21d1ca384a0f8e9e15b72 Deleted: sha256:486a66519b563bb65519d5a21918c2d9f796071b7194e2d356373e30cc5308fd Deleted: sha256:eeca4fa08e043687fe9dcda07bae826d5e95f98f4333e745729efc6bad865924 Deleted: sha256:10fdbd12d85ca92e06596edacefa0b12b2d0d7c5a63379eb43782670cef5ea32 Deleted: sha256:b42602d52ff1959e81db81a386f904c06ff2f7f799cc113d2c600beb57016a8e Deleted: sha256:33affdea4df245b373614e7bf070ba7b71a7f5bcb68c0fdde57bad40f07efcb8 Deleted: sha256:1c8b26baac3a8e27b2aa070e4cbc0d194dcdf6ffb6ae6ace32045401a9961b91 Untagged: goharbor/trivy-adapter-photon:v2.6.0 Deleted: sha256:f0bfdaf83591581b45d2cef279ca40dd56d6bc0d216a484f0398c4714c62efee Deleted: sha256:1aa4649d9ab4c9768ba40eb494f553c0f8a6b62df3f9560be76b68755c7eabd8 Deleted: sha256:6f26f3ef2dafa0f4da0250006988dd2a56534aa2c77a8d710ad431bb2b76cb6c Deleted: sha256:d6db7ce3fa73e895b9c4857f96e7813fe1dde4ddd235a82b7a3f6f60dbca01a5 Deleted: sha256:f03322a8ac662bd6315daa820278fd4a993b4239276aa7b34406b1be5efd7427 Deleted: sha256:ed0bbbf94bb0a0140b2dd03500d0f6d433c9ffdff635d2c8c6fca76e67fc1c95 Deleted: sha256:ea63f3c397d3000a69b1abd285938ef70983e2a1f70e17060ecf3e7d938dfbf3 Untagged: goharbor/redis-photon:v2.6.0 Untagged: goharbor/redis-photon@sha256:57efb4b5ec08357db015aa0b3eba747fe0c3095cda91ed15f1124f84f1b3d34c Deleted: sha256:39f3ba8729b958a33ae23201a521b65cb73b266c02227894ef1e4c9f04056f1f Deleted: sha256:4b189c6cfa2732d8d30f17257f5a1a753e51355908a6ab64ffba9868b27df750 Deleted: sha256:c67006aedc4d27a7fd691cdcb76cde5df7f823213065702b3b2f8706bc3f1dbc Deleted: sha256:df4f644f576c8f56f142aaa8b791fc452340ea6b35083cc350125d28c6aac3c4 Deleted: sha256:7461411a8176294e3c58f71b45749c7db7024c4d574b3f54cad8e1ad3e6b65af Untagged: goharbor/chartmuseum-photon:v2.6.0 Deleted: sha256:bd0057522e245133c6468711a423a3351690416abc30a0e21a9f75feb20471f0 Deleted: sha256:bf0e5aa41b8c8d972c43fdda322f1a6fb59f8bcbd193b3143a5e281407b27ac4 Deleted: sha256:bb3890e66d82885608ca77c7befa39c319b96fb7eca1edf27871fd6129073dd7 Deleted: sha256:60c178c0fcf109fcc406b2fd2437abea0002e44fe98bfc670f579aa55819157f Deleted: sha256:9430a890b79bd1cf5185c602312cedc378f012a59f1cd97d24901d4f95c71775 Deleted: sha256:e486bcf20fb10c65da621fa2c7fcc91cb60c056baa185277da47b2319be1623d Untagged: goharbor/harbor-exporter:v2.6.0 Deleted: sha256:abb2f54ff016beb4c74c699f4bdfed6c95278bfde96b544a848c028336197017 Deleted: sha256:fe5fc50773159f82d3af639061af4d533eacf5fc523842ab5deecf1c00c5179f Deleted: sha256:c1c32083534006b5ae25b6b75a212cf4140c78e064f9f8134a1edacf63ccbc18 Deleted: sha256:a0be2b7027e239a33409eff121fa710026343b709013768380a4c88601abcb8a Deleted: sha256:91fa8ceae8edd53f2bf1b9b007be1f3664168875b24e5b0d4af467a13ee2e11f Deleted: sha256:915f79eed965443878e67d93f8e0fdff5212c5c86763c093c2f8747f6adfc442 $ |
5. Habor 웹사이트 접속 확인
1. NPM에서 harbor sub domain 설정 및 SSL 인증서 적용 (NPM 사용에 대한 자세한 설명 생략)
2. NPM 설정한 https://harbor.<ID>.synology.me 주소로 웹사이트 접속
3. harbor 로그인 페이지 확인 -> ID/PW 입력 -> 로그인 확인
- ID : admin
- PW : harbor.yml 에 지정한 <ADMIN_PASSWORD> 입력
4. 관리자 로그인 확인
지금까지 harbor 서비스를 설치하고 관리자 로그인되는 것을 확인하였습니다.
6. 마치면서...
harbor는 9개의 컨테이너가 서로 연동하여 동작되는 혼합(?) 서비스이기 때문에
다른 docker image들에 비해서 설치가 복잡한 편에 속하는 것 같습니다.
가이드가 길어서 설치 과정이 다소 복잡해 보이지만 편리하게 install.sh 파일을 잘 제공해주고 있어서
harbor.yml 만 잘 설정해주면 docker-compose.yml이 자동 생성되어 9개의 컨테이너들이 알아서
설치/실행되니 설치 방법만 이해하신다면 어렵지 않게 세팅이 가능합니다.
private registry가 필요하신 분께서는 가이드 보시면서 천천히 따라 해 보세요.
harbor 세팅은 마쳤는데... private registry 사용법에 대한 내용은 설명이 쉽지 않아서...
따로 가이드를 정리하여 업로드 하겠습니다.
END
PS. 본 포스팅이 도움이 되셨다면 소중한 리플로 후기 공유해주세요. 광고 클릭도 큰 도움이 됩니다.
'Guide_Tip_Tech > Docker' 카테고리의 다른 글
docker ps --format 포멧 필터링 (0) | 2023.06.23 |
---|---|
[docker] harbor 사용법 #3 - harbor 서버 image 연동 실습 (docker tag, push, pull) (0) | 2022.09.03 |
[docker] harbor 사용법 #2 - docker client 설정 (insecure-registries) (0) | 2022.09.03 |
[docker] harbor 사용법 #1 - harbor 서버 설정 (0) | 2022.09.03 |
[docker] metube 설치 (docker-compose 방식) (0) | 2022.08.27 |
[docker] webdav 설치 (docker-compose 방식) (0) | 2022.08.08 |
[docker] navidrome 설치 (docker-compose 방식) (0) | 2022.08.08 |
[docker] komga 설치 (docker-compose 방식) (0) | 2022.08.08 |
[docker] kavita 설치 (docker-compose 방식) (0) | 2022.08.08 |
[docker] file browser 설치 (docker-compose 방식) (1) | 2022.08.08 |