Docker 镜像仓库 Harbor HTTPS部署

Docker 镜像仓库 Harbor HTTPS部署

部署环境:

环境:Centos-7.8.2003   Harbor-2.11.2

部署方式:docker 离线安装

部署准备:

harbor 环境依赖:

  硬件依赖:  

资源

最低配置

推荐配置

CPU

2 CPU

4 CPU

Mem

4 GB

8 GB

Disk

40 GB

160 GB

  软件依赖:

软件

版本要求

描述

Docker Engine

Version 20.10.10-ce+ 或 更高

有关安装说明,请参阅 Docker Engine documentation

Docker Compose

docker-compose (v1.18.0+) 或docker compose v2 (docker-compose-plugin)

有关安装说明,请参阅 Docker Compose documentation

OpenSSL

Latest is preferred

用于为 Harbor 生成证书和密钥

  网络依赖:

端口号

协议

描述

443

HTTPS

Harbor 门户和核心 API 接受此端口上的 HTTPS 请求。您可以在配置文件中更改此端口。

4443

HTTPS

与 Harbor 的 Docker 内容信任服务的连接。仅在启用 Notary 时才需要。您可以在配置文件中更改此端口。

80

HTTP

Harbor 门户和核心 API 接受此端口上的 HTTP 请求。您可以在配置文件中更改此端口。

离线部署:

Harbor Github项目地址

Harbor安装文件下载

复制代码
 1 [root@234 ~]# cd /opt
 2 
 3 [root@234 opt]# wget https://github.com/goharbor/harbor/releases/download/v2.11.2/harbor-offline-installer-v2.11.2.tgz
 4 
 5 --2025-02-10 10:37:55-- https://github.com/goharbor/harbor/releases/download/v2.11.2/harbor-offline-installer-v2.11.2.tgz
 6 
 7 正在解析主机 github.com (github.com)... 20.205.243.166
 8 
 9 正在连接 github.com (github.com)|20.205.243.166|:443... 已连接。
10 
11 已发出 HTTP 请求,正在等待回应... 302 Found
12 
13 位置:https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/915503a6-63b4-4b11-8e35-fde948b331ea?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250210%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250210T023756Z&X-Amz-Expires=300&X-Amz-Signature=a056b11267d3b2a6517f28d804fde22e508e3087cc840fac8ba2f7f2b9e33b2e&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dharbor-offline-installer-v2.11.2.tgz&response-content-type=application%2Foctet-stream [跟随至新的 URL]
14 
15 --2025-02-10 10:37:56-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/915503a6-63b4-4b11-8e35-fde948b331ea?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250210%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250210T023756Z&X-Amz-Expires=300&X-Amz-Signature=a056b11267d3b2a6517f28d804fde22e508e3087cc840fac8ba2f7f2b9e33b2e&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dharbor-offline-installer-v2.11.2.tgz&response-content-type=application%2Foctet-stream
16 
17 正在解析主机 objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
18 
19 正在连接 objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... 已连接。
20 
21 已发出 HTTP 请求,正在等待回应... 200 OK
22 
23 长度:627302753 (598M) [application/octet-stream]
24 
25 正在保存至: “harbor-offline-installer-v2.11.2.tgz”
26 
27 harbor-offline-installer-v2.11.2.tg 100%[===================================================================>] 598.24M 28.7MB/s 用时 24s
28 
29 2025-02-10 10:38:21 (24.8 MB/s) - 已保存 “harbor-offline-installer-v2.11.2.tgz” [627302753/627302753])
复制代码

 

解压及配置文件复制

1 [root@234 opt]# tar -zxf harbor-offline-installer-v2.11.2.tgz 
2 [root@234 opt]# ls
3 harbor harbor-offline-installer-v2.11.2.tgz
4 [root@234 opt]# cd harbor/
5 [root@234 harbor]# ls
6 common.sh harbor.v2.11.2.tar.gz harbor.yml.tmpl install.sh LICENSE prepare
7 [root@234 harbor]# cp harbor.yml.tmpl harbor.yml

 

 

使用openssl生成自签名证书

复制代码
 1 [root@234 harbor]# mkdir /opt/harbor/ssl
 2 
 3 [root@234 harbor]# cd /opt/harbor/ssl/
 4 
 5 ## 生成机构CA证书
 6 
 7 ### 生成CA证书私钥
 8 
 9 [root@234 ssl]# openssl genrsa -out ca.key 4096
10 
11 Generating RSA private key, 4096 bit long modulus (2 primes)
12 
13 ...........................................................++++
14 
15 ...........................................................................................................................................++++
16 
17 e is 65537 (0x010001)
18 
19 ### 生成CA证书
20 
21 [root@234 ssl]# openssl req -x509 -new -nodes -sha512 -days 3650 \
22 
23 -subj "/C=CN/ST=Beijing/L=Beijing/O=example/OU=Personal/CN=registry.harbor.com" \
24 
25 -key ca.key \
26 
27 -out ca.crt
28 
29 ## 生成服务器证书
30 
31 ### 生成服务器证书私钥
32 
33 [root@234 ssl]# openssl genrsa -out registry.harbor.com.key 4096
34 
35 Generating RSA private key, 4096 bit long modulus (2 primes)
36 
37 ....................................................................................................................................................................................................................................................................................................................................................++++
38 
39 ......................++++
40 
41 e is 65537 (0x010001)
42 
43 ### 生成签名
44 
45 [root@234 ssl]# openssl req -sha512 -new \
46 
47 -subj "/C=CN/ST=Beijing/L=Beijing/O=example/OU=Personal/CN=registry.harbor.com" \
48 
49 -key registry.harbor.com.key \
50 
51 -out registry.harbor.com.csr
52 
53 ### 生成x509 v3扩展文件
54 
55 [root@234 ssl]# cat > v3.ext <<-EOF
56 
57 > authorityKeyIdentifier=keyid,issuer
58 
59 > basicConstraints=CA:FALSE
60 
61 > keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
62 
63 > extendedKeyUsage = serverAuth
64 
65 > subjectAltName = @alt_names
66 
67 >
68 
69 > [alt_names]
70 
71 > DNS.1=registry.harbor.com
72 
73 > DNS.2=registry.harbor
74 
75 > DNS.3=harbor
76 
77 > EOF
78 
79 ### 生成服务器证书
80 
81 [root@234 ssl]# openssl x509 -req -sha512 -days 3650 \
82 
83 > -extfile v3.ext \
84 
85 > -CA ca.crt -CAkey ca.key -CAcreateserial \
86 
87 > -in registry.harbor.com.csr \
88 
89 > -out registry.harbor.com.crt
90 
91 Signature ok
92 
93 subject=C = CN, ST = Beijing, L = Beijing, O = example, OU = Personal, CN = registry.harbor.com
94 
95 Getting CA Private Key
复制代码

 

编辑harbor.yml配置文件

复制代码
  1 [root@234 harbor]# vi harbor.yml
  2 
  3 # Configuration file of Harbor
  4 
  5 # The IP address or hostname to access admin UI and registry service.
  6 
  7 # DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
  8 
  9 hostname: registry.harbor.com                  ## 更改为你的IP地址或域名,https访问时建议配置为域名,此处示例配置为:registry.harbor.com ;
 10 
 11 # http related config
 12 
 13 http:
 14 
 15 # port for http, default is 80. If https enabled, this port will redirect to https port
 16 
 17 port: 80 ## 配置你的http访问端口
 18 
 19 # https related config
 20 
 21 https:
 22 
 23 # https port for harbor, default is 443
 24 
 25 port: 443 ## 配置你的https访问端口
 26 
 27 # The path of cert and key files for nginx
 28 
 29 certificate: /opt/harbor/ssl/registry.harbor.com.crt ## 配置你的证书
 30 
 31 private_key: /opt/harbor/ssl/registry.harbor.com.key ## 配置你的密钥
 32 
 33 # enable strong ssl ciphers (default: false)
 34 
 35 # strong_ssl_ciphers: false
 36 
 37 # # Harbor will set ipv4 enabled only by default if this block is not configured
 38 
 39 # # Otherwise, please uncomment this block to configure your own ip_family stacks
 40 
 41 # ip_family:
 42 
 43 # # ipv6Enabled set to true if ipv6 is enabled in docker network, currently it affected the nginx related component
 44 
 45 # ipv6:
 46 
 47 # enabled: false
 48 
 49 # # ipv4Enabled set to true by default, currently it affected the nginx related component
 50 
 51 # ipv4:
 52 
 53 # enabled: true
 54 
 55 # # Uncomment following will enable tls communication between all harbor components
 56 
 57 # internal_tls:
 58 
 59 # # set enabled to true means internal tls is enabled
 60 
 61 # enabled: true
 62 
 63 # # put your cert and key files on dir
 64 
 65 # dir: /etc/harbor/tls/internal
 66 
 67 # Uncomment external_url if you want to enable external proxy
 68 
 69 # And when it enabled the hostname will no longer used
 70 
 71 # external_url: https://reg.mydomain.com:8433
 72 
 73 # The initial password of Harbor admin
 74 
 75 # It only works in first time to install harbor
 76 
 77 # Remember Change the admin password from UI after launching Harbor.
 78 
 79 harbor_admin_password: Harbor12345 ## 配置你的Harbor访问密码,即首次安装后使用admin登录时所用的密码,默认是Harbor12345;
 80 
 81 # Harbor DB configuration
 82 
 83 database:
 84 
 85 # The password for the root user of Harbor DB. Change this before any production use.
 86 
 87 password: root123 ## 配置你的数据库密码,可不用修改;
 88 
 89 # The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
 90 
 91 max_idle_conns: 100
 92 
 93 # The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
 94 
 95 # Note: the default number of connections is 1024 for postgres of harbor.
 96 
 97 max_open_conns: 900
 98 
 99 # The maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If it <= 0, connections are not closed due to a connection's age.
100 
101 # The value is a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
102 
103 conn_max_lifetime: 5m
104 
105 # The maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If it <= 0, connections are not closed due to a connection's idle time.
106 
107 # The value is a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
108 
109 conn_max_idle_time: 0
110 
111 # The default data volume
112 
113 data_volume: /data ## 配置Harbor的数据存储目录
114 
115 ...
复制代码

 

安装harbor

复制代码
  1 [root@234 harbor]# ./install.sh
  2 
  3 [Step 0]: checking if docker is installed ...
  4 
  5 Note: docker version: 20.10.12
  6 
  7 [Step 1]: checking docker-compose is installed ...
  8 
  9 Note: docker-compose version: 2.29.7
 10 
 11 [Step 2]: loading Harbor images ...
 12 
 13 7e3e085aad00: Loading layer [==================================================>] 40.56MB/40.56MB
 14 
 15 b7c5fb3793f7: Loading layer [==================================================>] 8.645MB/8.645MB
 16 
 17 8699e44017ac: Loading layer [==================================================>] 4.096kB/4.096kB
 18 
 19 5acf2113ede5: Loading layer [==================================================>] 3.072kB/3.072kB
 20 
 21 5b27c976d4e4: Loading layer [==================================================>] 17.86MB/17.86MB
 22 
 23 99dce882a0b7: Loading layer [==================================================>] 18.65MB/18.65MB
 24 
 25 Loaded image: goharbor/registry-photon:v2.11.2
 26 
 27 735708850366: Loading layer [==================================================>] 115.6MB/115.6MB
 28 
 29 14d29efa6a3e: Loading layer [==================================================>] 6.703MB/6.703MB
 30 
 31 3c01418d025f: Loading layer [==================================================>] 251.9kB/251.9kB
 32 
 33 391e512c63f4: Loading layer [==================================================>] 1.477MB/1.477MB
 34 
 35 Loaded image: goharbor/harbor-portal:v2.11.2
 36 
 37 2c25bffefb46: Loading layer [==================================================>] 11.6MB/11.6MB
 38 
 39 d53b6b501f40: Loading layer [==================================================>] 3.584kB/3.584kB
 40 
 41 723ee3ad357e: Loading layer [==================================================>] 2.56kB/2.56kB
 42 
 43 1d345de45454: Loading layer [==================================================>] 67.03MB/67.03MB
 44 
 45 5ae1f905cf80: Loading layer [==================================================>] 5.632kB/5.632kB
 46 
 47 5aacaf2bd0a6: Loading layer [==================================================>] 125.4kB/125.4kB
 48 
 49 b41bbf91b8f8: Loading layer [==================================================>] 201.7kB/201.7kB
 50 
 51 ccd95252247d: Loading layer [==================================================>] 68.15MB/68.15MB
 52 
 53 35d4ae1c56b8: Loading layer [==================================================>] 2.56kB/2.56kB
 54 
 55 Loaded image: goharbor/harbor-core:v2.11.2
 56 
 57 25f6d303fc1c: Loading layer [==================================================>] 125.2MB/125.2MB
 58 
 59 6a3e4e4a22f7: Loading layer [==================================================>] 3.584kB/3.584kB
 60 
 61 2451c9db432c: Loading layer [==================================================>] 3.072kB/3.072kB
 62 
 63 42be28bb03c4: Loading layer [==================================================>] 2.56kB/2.56kB
 64 
 65 0d32464f8e56: Loading layer [==================================================>] 3.072kB/3.072kB
 66 
 67 83fea3b73ca4: Loading layer [==================================================>] 3.584kB/3.584kB
 68 
 69 84774a42cbee: Loading layer [==================================================>] 20.48kB/20.48kB
 70 
 71 Loaded image: goharbor/harbor-log:v2.11.2
 72 
 73 95fb141e4a22: Loading layer [==================================================>] 16.35MB/16.35MB
 74 
 75 e7c0b354cb9b: Loading layer [==================================================>] 175MB/175MB
 76 
 77 7b10d6a1815a: Loading layer [==================================================>] 26.1MB/26.1MB
 78 
 79 74a898a79638: Loading layer [==================================================>] 18.44MB/18.44MB
 80 
 81 931e5f3b6a94: Loading layer [==================================================>] 5.12kB/5.12kB
 82 
 83 f4b563aea366: Loading layer [==================================================>] 6.144kB/6.144kB
 84 
 85 2a1fb073de9b: Loading layer [==================================================>] 3.072kB/3.072kB
 86 
 87 78383705f279: Loading layer [==================================================>] 2.048kB/2.048kB
 88 
 89 a1e5fb322262: Loading layer [==================================================>] 2.56kB/2.56kB
 90 
 91 958e977e7694: Loading layer [==================================================>] 7.68kB/7.68kB
 92 
 93 Loaded image: goharbor/harbor-db:v2.11.2
 94 
 95 87f25aec2a57: Loading layer [==================================================>] 11.6MB/11.6MB
 96 
 97 c233354a43b9: Loading layer [==================================================>] 3.584kB/3.584kB
 98 
 99 d49be8eb0188: Loading layer [==================================================>] 2.56kB/2.56kB
100 
101 0b6ebe66006c: Loading layer [==================================================>] 54.2MB/54.2MB
102 
103 f3d9d03f3291: Loading layer [==================================================>] 54.99MB/54.99MB
104 
105 Loaded image: goharbor/harbor-jobservice:v2.11.2
106 
107 f3516a4426ea: Loading layer [==================================================>] 8.645MB/8.645MB
108 
109 e5ba977ab436: Loading layer [==================================================>] 4.096kB/4.096kB
110 
111 ff84095a1129: Loading layer [==================================================>] 17.86MB/17.86MB
112 
113 bf86942e0e5f: Loading layer [==================================================>] 3.072kB/3.072kB
114 
115 5f4a426c3fc9: Loading layer [==================================================>] 38.78MB/38.78MB
116 
117 151dd1100160: Loading layer [==================================================>] 57.42MB/57.42MB
118 
119 Loaded image: goharbor/harbor-registryctl:v2.11.2
120 
121 8d04e586bf47: Loading layer [==================================================>] 115.6MB/115.6MB
122 
123 Loaded image: goharbor/nginx-photon:v2.11.2
124 
125 23e78727ab4a: Loading layer [==================================================>] 9.137MB/9.137MB
126 
127 8c28d2bfc282: Loading layer [==================================================>] 4.096kB/4.096kB
128 
129 9ed1df8a63f5: Loading layer [==================================================>] 3.072kB/3.072kB
130 
131 68142b296c5e: Loading layer [==================================================>] 133.8MB/133.8MB
132 
133 235478fb591e: Loading layer [==================================================>] 14.89MB/14.89MB
134 
135 82d21983f014: Loading layer [==================================================>] 149.5MB/149.5MB
136 
137 Loaded image: goharbor/trivy-adapter-photon:v2.11.2
138 
139 faebe453cc4b: Loading layer [==================================================>] 106.7MB/106.7MB
140 
141 e8d8565c9983: Loading layer [==================================================>] 46.48MB/46.48MB
142 
143 9c15ef707b0c: Loading layer [==================================================>] 13.86MB/13.86MB
144 
145 771d6693db72: Loading layer [==================================================>] 66.05kB/66.05kB
146 
147 7db7ce7738f9: Loading layer [==================================================>] 2.56kB/2.56kB
148 
149 029c27b3f91b: Loading layer [==================================================>] 1.536kB/1.536kB
150 
151 659dc40ce3b7: Loading layer [==================================================>] 12.29kB/12.29kB
152 
153 ee793768fa5f: Loading layer [==================================================>] 2.746MB/2.746MB
154 
155 c6844997789a: Loading layer [==================================================>] 492.5kB/492.5kB
156 
157 Loaded image: goharbor/prepare:v2.11.2
158 
159 6d23bb381515: Loading layer [==================================================>] 11.6MB/11.6MB
160 
161 affe8930250d: Loading layer [==================================================>] 28.46MB/28.46MB
162 
163 3c22ae1a8288: Loading layer [==================================================>] 4.608kB/4.608kB
164 
165 77dcdafb6660: Loading layer [==================================================>] 29.25MB/29.25MB
166 
167 Loaded image: goharbor/harbor-exporter:v2.11.2
168 
169 809f11a2a8fa: Loading layer [==================================================>] 16.35MB/16.35MB
170 
171 cd64e0c8c9c1: Loading layer [==================================================>] 110.6MB/110.6MB
172 
173 b8a0c0f2e1cb: Loading layer [==================================================>] 3.072kB/3.072kB
174 
175 4623c5b1c6fc: Loading layer [==================================================>] 59.9kB/59.9kB
176 
177 ce9fdd61da0b: Loading layer [==================================================>] 61.95kB/61.95kB
178 
179 Loaded image: goharbor/redis-photon:v2.11.2
180 
181 [Step 3]: preparing environment ...
182 
183 [Step 4]: preparing harbor configs ...
184 
185 prepare base dir is set to /opt/harbor
186 
187 Generated configuration file: /config/portal/nginx.conf
188 
189 Generated configuration file: /config/log/logrotate.conf
190 
191 Generated configuration file: /config/log/rsyslog_docker.conf
192 
193 Generated configuration file: /config/nginx/nginx.conf
194 
195 Generated configuration file: /config/core/env
196 
197 Generated configuration file: /config/core/app.conf
198 
199 Generated configuration file: /config/registry/config.yml
200 
201 Generated configuration file: /config/registryctl/env
202 
203 Generated configuration file: /config/registryctl/config.yml
204 
205 Generated configuration file: /config/db/env
206 
207 Generated configuration file: /config/jobservice/env
208 
209 Generated configuration file: /config/jobservice/config.yml
210 
211 Generated and saved secret to file: /data/secret/keys/secretkey
212 
213 Successfully called func: create_root_cert
214 
215 Generated configuration file: /compose_location/docker-compose.yml
216 
217 Clean up the input dir
218 
219 Note: stopping existing Harbor instance ...
220 
221 WARN[0000] /opt/harbor/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
222 
223 [Step 5]: starting Harbor ...
224 
225 WARN[0000] /opt/harbor/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
226 
227 [+] Running 10/10
228 
229 ✔ Network harbor_harbor Created 0.3s
230 
231 ✔ Container harbor-log Started 1.3s
232 
233 ✔ Container redis Started 2.4s
234 
235 ✔ Container registryctl Started 2.5s
236 
237 ✔ Container registry Started 2.2s
238 
239 ✔ Container harbor-db Started 2.4s
240 
241 ✔ Container harbor-portal Started 2.4s
242 
243 ✔ Container harbor-core Started 3.1s
244 
245 ✔ Container nginx Started 3.9s
246 
247 ✔ Container harbor-jobservice Started 3.9s
248 
249 ✔ ----Harbor has been installed and started successfully.----
复制代码

 

访问harbor仓库

本机使用域名访问的话,修改你电脑的Hosts文件

文件位置:C:\Windows\System32\drivers\etc

浏览器输入地址:registry.harbor.com并访问:

 

docker配置自建harbor仓库

复制代码
  1 [root@228 ~]# vi /etc/docker/daemon.json
  2 
  3 {
  4 
  5 "insecure-registries":["registry.harbor.com"] ## 要在本地Hosts文件内配置对应的域名解析
  6 
  7 }
  8 
  9 ## 重启docker服务
 10 
 11 [root@228 ~]# systemctl restart docker
 12 
 13 [root@228 ~]# docker info
 14 
 15 Client:
 16 
 17 Context: default
 18 
 19 Debug Mode: false
 20 
 21 Plugins:
 22 
 23 buildx: Docker Buildx (Docker Inc., v0.14.0)
 24 
 25 compose: Docker Compose (Docker Inc., v2.27.0)
 26 
 27 Server:
 28 
 29 Containers: 4
 30 
 31 Running: 0
 32 
 33 Paused: 0
 34 
 35 Stopped: 4
 36 
 37 Images: 10
 38 
 39 Server Version: 20.10.12
 40 
 41 Storage Driver: overlay2
 42 
 43 Backing Filesystem: xfs
 44 
 45 Supports d_type: true
 46 
 47 Native Overlay Diff: true
 48 
 49 userxattr: false
 50 
 51 Logging Driver: json-file
 52 
 53 Cgroup Driver: cgroupfs
 54 
 55 Cgroup Version: 1
 56 
 57 Plugins:
 58 
 59 Volume: local
 60 
 61 Network: bridge host ipvlan macvlan null overlay
 62 
 63 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 64 
 65 Swarm: active
 66 
 67 NodeID: b4q30pcmvr1oy0knaj6fcvbdf
 68 
 69 Is Manager: false
 70 
 71 Node Address: 192.168.100.228
 72 
 73 Manager Addresses:
 74 
 75 192.168.100.234:2377
 76 
 77 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 78 
 79 Default Runtime: runc
 80 
 81 Init Binary: docker-init
 82 
 83 containerd version: 8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89
 84 
 85 runc version: v1.0.2-0-g52b36a2d
 86 
 87 init version: de40ad0
 88 
 89 Security Options:
 90 
 91 seccomp
 92 
 93 Profile: default
 94 
 95 Kernel Version: 4.19.90-52.22.v2207.ky10.x86_64
 96 
 97 Operating System: Kylin Linux Advanced Server V10 (Lance)
 98 
 99 OSType: linux
100 
101 Architecture: x86_64
102 
103 CPUs: 4
104 
105 Total Memory: 6.53GiB
106 
107 Name: 228
108 
109 ID: CCLD:RWRS:BD3F:6KB6:TZK4:OYLN:6YTZ:RHXU:YX46:RH63:NX46:7PFQ
110 
111 Docker Root Dir: /var/lib/docker
112 
113 Debug Mode: false
114 
115 Registry: https://index.docker.io/v1/
116 
117 Labels:
118 
119 Experimental: false
120 
121 Insecure Registries:
122 
123 registry.harbor.com
124 
125 127.0.0.0/8
126 
127 Live Restore Enabled: false
128 
129 Product License: Community Engine
130 
131 ## 登录仓库
132 
133 [root@228 ~]# docker login registry.harbor.com
134 
135 Username: admin
136 
137 Password:
138 
139 WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
140 
141 Configure a credential helper to remove this warning. See
142 
143 https://docs.docker.com/engine/reference/commandline/login/#credentials-store
144 
145 Login Succeeded
146 
147 ## 推送镜像
148 
149 [root@228 ~]# docker push registry.harbor.com/library/memcached:latest
150 
151 The push refers to repository [registry.harbor.com/library/memcached]
152 
153 5861f383d266: Pushed
154 
155 936edbeafb14: Pushed
156 
157 354bd066f94c: Pushed
158 
159 78ca6ef1456e: Pushed
160 
161 aea352bdeb3d: Pushed
162 
163 7914c8f600f5: Pushed
164 
165 latest: digest: sha256:6687f379e8212007e627074da61b51b5c967b7adda82427ac275fd59450e04e6 size: 1573
复制代码

 

以上就是使用harbor自建docker仓库的全部过程

posted @   Linux小飞象  阅读(72)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示