Docker-配置私有倉庫(Harbor)

配置私有倉庫(Harbor)

  • 一、環境準備
    • 安裝 Docker
  • 三、安裝docker-compose
  • 四、準備Harbor
  • 五、配置證書
  • 六、部署配置Harbor
  • 七、配置啟動服務
  • 八、定制本地倉庫
  • 九、測試本地倉庫

Harbor(港灣),是一個用于 存儲分發 Docker 鏡像的企業級 Registry 服務器。

一、環境準備

# 修改主機名
[root@docker ~]# hostnamectl hostname harbor# 修改IP
[root@docker ~]# ip ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:f5:e5:24 brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.86.132/24 brd 192.168.86.255 scope global dynamic noprefixroute ens160valid_lft 1672sec preferred_lft 1672secinet6 fe80::20c:29ff:fef5:e524/64 scope link noprefixroute valid_lft forever preferred_lft forever
3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:f5:e5:2e brd ff:ff:ff:ff:ff:ffaltname enp19s0inet 192.168.98.159/24 brd 192.168.98.255 scope global dynamic noprefixroute ens224valid_lft 1672sec preferred_lft 1672secinet6 fe80::fd7d:606d:1a1b:d3cc/64 scope link noprefixroute valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether ae:a7:3e:3a:39:bb brd ff:ff:ff:ff:ff:ffinet 172.17.0.1/16 brd 172.17.255.255 scope global docker0valid_lft forever preferred_lft forever
[root@docker ~]# nmcli c show 
NAME                UUID                                  TYPE      DEVICE  
Wired connection 1  110c742f-bd12-3ba3-b671-1972a75aa2e6  ethernet  ens224  
ens160              d622d6da-1540-371d-8def-acd3db9bd38d  ethernet  ens160  
lo                  d20cef01-6249-4012-908c-f775efe44118  loopback  lo      
docker0             b023990a-e131-4a68-828c-710158f77a50  bridge    docker0 
[root@docker ~]# nmcli c m "Wired connection 1" connection.id ens224
[root@docker ~]# nmcli c show 
NAME     UUID                                  TYPE      DEVICE  
ens224   110c742f-bd12-3ba3-b671-1972a75aa2e6  ethernet  ens224  
ens160   d622d6da-1540-371d-8def-acd3db9bd38d  ethernet  ens160  
lo       d20cef01-6249-4012-908c-f775efe44118  loopback  lo      
docker0  b023990a-e131-4a68-828c-710158f77a50  bridge    docker0 
[root@docker ~]# nmcli c m ens224 ipv4.method manual ipv4.addresses 192.168.98.20/24 ipv4.gateway 192.168.98.2 ipv4.dns 223.5.5.5 connection.autoconnect yes
[root@docker ~]# nmcli c up ens224 
[root@harbor ~]# nmcli c m ens160 ipv4.method manual ipv4.addresses 192.168.86.20/24 ipv4.gateway 192.168.86.200 ipv4.dns "223.5.5.5 8.8.8.8" connection.autoconnect yes
[root@harbor ~]# nmcli c up ens160 
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
[root@harbor ~]# ip ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:f5:e5:24 brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.86.20/24 brd 192.168.86.255 scope global noprefixroute ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fef5:e524/64 scope link noprefixroute valid_lft forever preferred_lft forever
3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:f5:e5:2e brd ff:ff:ff:ff:ff:ffaltname enp19s0inet 192.168.98.20/24 brd 192.168.98.255 scope global noprefixroute ens224valid_lft forever preferred_lft foreverinet6 fe80::fd7d:606d:1a1b:d3cc/64 scope link noprefixroute valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether ae:a7:3e:3a:39:bb brd ff:ff:ff:ff:ff:ffinet 172.17.0.1/16 brd 172.17.255.255 scope global docker0valid_lft forever preferred_lft forever# 開啟路由轉發
[root@harbor ~]# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf 
[root@harbor ~]# sysctl -p
net.ipv4.ip_forward = 1# 配置主機映射
[root@harbor ~]# vim /etc/hosts
[root@harbor ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.86.11 k8s-master01 m1
192.168.86.12 k8s-node01 n1
192.168.86.13 k8s-node02 n2
192.168.86.20 harbor.registry.com harbor	#僅主機IP

安裝 Docker

  • 清華鏡像安裝方法
    1. 先執行dnf remove
    2. 安裝必要的一些系統工具
    yum install -y yum-utils
    3. 添加軟件源信息
    yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/rhel/docker-ce.repo
    4. 安裝Docker
    yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    5. 開啟Docker服務
    systemctl enable --now docker
    6. 驗證 Docker
    docker info
# 查看是否掛載
[root@harbor ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.# 1.先執行dnf remove 
[root@docker ~]# dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \
podman \
runc	#以上內容復制粘貼回車,保證沒有dockerUpdating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register.No match for argument: docker
No match for argument: docker-client
No match for argument: docker-client-latest
No match for argument: docker-common
No match for argument: docker-latest
No match for argument: docker-latest-logrotate
No match for argument: docker-logrotate
No match for argument: docker-engine
No match for argument: podman
No match for argument: runc
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!# 2.安裝必要的一些系統工具
[root@harbor ~]# yum install -y yum-utils
Updating Subscription Management repositories.
Unable to read consumer identity# 3.添加軟件源信息
[root@harbor ~]# yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/rhel/docker-ce.repo
Updating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register.Adding repo from: https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/rhel/docker-ce.repo  #成功[root@harbor ~]# ls /etc/yum.repos.d/
dnf.repo  docker-ce.repo  redhat.repo# 4.安裝 Docker
[root@harbor ~]# yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Updating Subscription Management repositories.
Unable to read consumer identity#安裝成功:
[root@docker ~]# docker -v
Docker version 28.0.4, build b8034c0# 5.開啟Docker服務
[root@harbor ~]# systemctl enable --now docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /u               sr/lib/systemd/system/docker.service.
[root@harbor ~]# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
  • 注意:
# 有就改寫,沒有就創建
[root@harbor ~]# vim /etc/docker/daemon.json
[root@harbor ~]# cat /etc/docker/daemon.json
{"default-ipc-mode": "shareable",	#ipc模式打開"data-root": "/data/docker",		#指定docker數據放在哪個目錄"exec-opts": ["native.cgroupdriver=systemd"],	#指定cgroup的驅動方式是systemd"log-driver": "json-file",	#格式json"log-opts": {"max-size": "100m","max-file": "50"},"insecure-registries": ["https://harbor.registry.com"],	#自己的倉庫的地址(私有倉庫)"registry-mirrors":[	#拉取鏡像(公共倉庫)"https://docker.m.daocloud.io","https://docker.imgdb.de","https://docker-0.unsee.tech","https://docker.hlmirror.com","https://docker.1ms.run","https://func.ink","https://lispy.org","https://docker.xiaogenban1993.com"]
}
[root@harbor ~]# mkdir -p /data/docker 
[root@harbor ~]# systemctl restart docker
[root@harbor ~]# ls /data/docker/
buildkit  containers  engine-id  image  network  overlay2  plugins  runtimes  swarm  tmp  volumes
[root@harbor ~]# systemctl daemon-reload
[root@harbor ~]# systemctl restart docker# 驗證Docker
[root@harbor ~]# docker info | grep "Registry Mirrors" -A 5Registry Mirrors:https://docker.1ms.run/https://func.ink/https://proxy.1panel.live/https://docker-0.unsee.tech/https://docker.zhai.cm/

三、安裝docker-compose

  • 通過 xftp 拖拽 docker-compose-linux-x86_64 文件至根目錄下
[root@harbor ~]# mv docker-compose-linux-x86_64 /usr/bin/docker-compose# 賦權
[root@harbor ~]# chmod +x /usr/bin/docker-compose # 驗證
[root@harbor ~]# docker-compose --version
Docker Compose version v2.35.1

四、準備Harbor

# 已經創建存儲數據目錄,切換到此目錄
[root@harbor ~]# cd /data/# 通過 xftp 拖拽harbor-offline-installer-v2.13.0.tgz文件到此目錄
[root@harbor data]# mv /root/harbor-offline-installer-v2.13.0.tgz .
[root@harbor data]# ls
docker  harbor-offline-installer-v2.13.0.tgz# 解壓文件
[root@harbor data]# tar -xzf harbor-offline-installer-v2.13.0.tgz 
[root@harbor data]# ls
docker  harbor  harbor-offline-installer-v2.13.0.tgz
[root@harbor data]# rm -f *.tgz
[root@harbor data]# ls
docker  harbor# 切換目錄
[root@harbor data]# cd harbor/
[root@harbor harbor]# ls
common.sh  harbor.v2.13.0.tar.gz  harbor.yml.tmpl  install.sh  LICENSE  prepare

五、配置證書

通過鏈接: harbor安裝前提條件
在這里插入圖片描述

  • 生成CA證書
[root@harbor harbor]# mkdir ssl
[root@harbor harbor]# cd ssl#生成CA證書私鑰
[root@harbor ssl]# openssl genrsa -out ca.key 4096
[root@harbor ssl]# ls
ca.key#生成CA證書
[root@harbor ssl]# openssl req -x509 -new -nodes -sha512 -days 3650 \-subj "/C=CN/ST=Chongqing/L=Banan/O=example/OU=Personal/CN=MyPersonal Root CA" \-key ca.key \-out ca.crt
[root@harbor ssl]# ls
ca.crt  ca.key
  • 生成服務器證書(證書通常包含一個.crt 文件和一個.key 文件)
# 生成私鑰
[root@harbor ssl]# openssl genrsa -out harbor.registry.com.key 4096
[root@harbor ssl]# ls
ca.crt  ca.key  harbor.registry.com.key# 生成證書簽名請求(CSR)
[root@harbor ssl]# openssl req -sha512 -new \-subj "/C=CN/ST=Chongqing/L=Banan/O=example/OU=Personal/CN=harbor.registry.com" \-key harbor.registry.com.key \-out harbor.registry.com.csr
[root@harbor ssl]# ls
ca.crt  ca.key  harbor.registry.com.csr  harbor.registry.com.key# 生成一個x509 v3擴展文件
[root@harbor ssl]# cat > v3.ext <<-EOF
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names[alt_names]
DNS.1=harbor.registry.com
DNS.2=harbor.registry
DNS.3=harbor
EOF
[root@harbor ssl]# ls
ca.crt  ca.key  harbor.registry.com.csr  harbor.registry.com.key  v3.ext# 使用該v3.ext文件為您的Harbor主機生成證書
[root@harbor ssl]# openssl x509 -req -sha512 -days 3650 \-extfile v3.ext \-CA ca.crt -CAkey ca.key -CAcreateserial \-in harbor.registry.com.csr \-out harbor.registry.com.crt
Certificate request self-signature ok
subject=C=CN, ST=Chongqing, L=Banan, O=example, OU=Personal, CN=harbor.registry.com
[root@harbor ssl]# ls
ca.crt  ca.key  ca.srl  harbor.registry.com.crt  harbor.registry.com.csr  harbor.registry.com.key  v3.ext
  • 向Harbor和Docker提供證書

生成 ca.crt、harbor.registry.com.crt 和 harbor.registry.com 密鑰文件后,您必須將它們提供給 Harbor 和 Docker,并重新配置 Harbor 以使用它們。

# 將服務器證書和密鑰復制到 Harbor 主機上的 certficates 文件夾中
[root@harbor ssl]# mkdir /data/cert
[root@harbor ssl]# cp harbor.registry.com.crt /data/cert/
cp harbor.registry.com.key /data/cert/
[root@harbor ssl]# ls /data/cert/
harbor.registry.com.crt  harbor.registry.com.key# 轉換 harbor.registry.com.crt 為 harbor.registry.com.cert,供 Docker 使用
[root@harbor ssl]# openssl x509 -inform PEM -in harbor.registry.com.crt -out harbor.registry.com.cert
[root@harbor ssl]# ls
ca.crt  ca.srl                    harbor.registry.com.crt  harbor.registry.com.key
ca.key  harbor.registry.com.cert  harbor.registry.com.csr  v3.ext# 將服務器證書,密鑰和 CA 文件復制到 Harbor 主機上的 Docker 證書文件夾中。必須首先創建適當的文件夾
[root@harbor ssl]# mkdir -p /etc/docker/certs.d/harbor.registry.com:443
[root@harbor ssl]# cp harbor.registry.com.cert /etc/docker/certs.d/harbor.registry.com:443/
[root@harbor ssl]# cp harbor.registry.com.key /etc/docker/certs.d/harbor.registry.com:443/
[root@harbor ssl]# cp ca.crt /etc/docker/certs.d/harbor.registry.com:443/# 重新啟動Docker Engine
[root@harbor ssl]# systemctl restart docker
[root@harbor ssl]# systemctl status docker
● docker.service - Docker Application Container EngineLoaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: disabled)Active: active (running) since Sun 2025-05-11 10:42:37 CST; 1min 25s ago
TriggeredBy: ● docker.socketDocs: https://docs.docker.comMain PID: 3322 (dockerd)Tasks: 10Memory: 29.7MCPU: 353msCGroup: /system.slice/docker.service└─3322 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sockMay 11 10:42:36 harbor dockerd[3322]: time="2025-05-11T10:42:36.466441227+08:00" level=info msg="Creating a contai>

六、部署配置Harbor

  • 配置 Harbor
# 從配置模板復制配置文件
[root@harbor ssl]# cd ..
[root@harbor harbor]# ls
common.sh  harbor.v2.13.0.tar.gz  harbor.yml.tmpl  install.sh  LICENSE  prepare  ssl
[root@harbor harbor]# cp harbor.yml.tmpl harbor.yml# 修改配置文件
[root@harbor harbor]# vim harbor.yml
[root@harbor harbor]# cat harbor.yml
# Configuration file of Harbor# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: harbor.registry.com  #修改# http related config
http:# port for http, default is 80. If https enabled, this port will redirect to https portport: 80# https related config
https:# https port for harbor, default is 443port: 443# The path of cert and key files for nginxcertificate: /data/cert/harbor.registry.com.crt  #修改private_key: /data/cert/harbor.registry.com.key  #修改
...............
  • 加載harbor鏡像
[root@harbor harbor]# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
[root@harbor harbor]# docker load -i harbor.v2.13.0.tar.gz 
874b37071853: Loading layer [==================================================>]  
........
832349ff3d50: Loading layer [==================================================>]  38.95MB/38.95MB
Loaded image: goharbor/harbor-exporter:v2.13.0
[root@harbor harbor]# docker images
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
goharbor/harbor-exporter        v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon           v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon   v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl     v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon        v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon           v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log             v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice      v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core            v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal          v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db              v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                v2.13.0   2380b5a4f127   4 weeks ago   205MB
  • 檢查安裝環境
[root@harbor harbor]# ls
common.sh  harbor.v2.13.0.tar.gz  harbor.yml  harbor.yml.tmpl  install.sh  LICENSE  prepare  ssl
[root@harbor harbor]# ./prepare
prepare base dir is set to /data/harbor
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
copy /data/secret/tls/harbor_internal_ca.crt to shared trust ca dir as name harbor_internal_ca.crt ...
ca file /hostfs/data/secret/tls/harbor_internal_ca.crt is not exist
copy  to shared trust ca dir as name storage_ca_bundle.crt ...
copy None to shared trust ca dir as name redis_tls_ca.crt ...
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
  • 啟動Harbor
# 啟動harbor
[root@harbor harbor]# ./install.sh[Step 0]: checking if docker is installed ...Note: docker version: 28.0.4[Step 1]: checking docker-compose is installed ...Note: Docker Compose version v2.34.0[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-db:v2.13.0
Loaded image: goharbor/harbor-jobservice:v2.13.0
Loaded image: goharbor/harbor-registryctl:v2.13.0
Loaded image: goharbor/redis-photon:v2.13.0
Loaded image: goharbor/trivy-adapter-photon:v2.13.0
Loaded image: goharbor/nginx-photon:v2.13.0
Loaded image: goharbor/registry-photon:v2.13.0
Loaded image: goharbor/prepare:v2.13.0
Loaded image: goharbor/harbor-portal:v2.13.0
Loaded image: goharbor/harbor-core:v2.13.0
Loaded image: goharbor/harbor-log:v2.13.0
Loaded image: goharbor/harbor-exporter:v2.13.0[Step 3]: preparing environment ...[Step 4]: preparing harbor configs ...
prepare base dir is set to /data/harbor
Clearing the configuration file: /config/portal/nginx.conf
.......
Generated configuration file: /config/portal/nginx.conf
.......
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
copy /data/secret/tls/harbor_internal_ca.crt to shared trust ca dir as name harbor_internal_ca.crt ...
ca file /hostfs/data/secret/tls/harbor_internal_ca.crt is not exist
copy  to shared trust ca dir as name storage_ca_bundle.crt ...
copy None to shared trust ca dir as name redis_tls_ca.crt ...
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dirNote: stopping existing Harbor instance ...[Step 5]: starting Harbor ...
[+] Running 10/10		#10個容器成功運行? Network harbor_harbor        Created                                                                       0.0s 
.........                                                                    1.3s 
? ----Harbor has been installed and started successfully.----

七、配置啟動服務

  • 停止Harbor
    由于現在啟動 Harbor 的操作必須是在 docker-compose.yml 文件所在目錄下執行,非常不方便。所以我們先使用 docker-compose 命令來關閉 Harbor 服務
# 會刪容器,但是不會刪除鏡像
[root@harbor harbor]# docker-compose down
[+] Running 10/10? Container harbor-jobservice  Removed                                                                       0.1s ? Container registryctl        Removed                                                                       0.1s ? Container nginx              Removed                                                                       0.1s ? Container harbor-portal      Removed                                                                       0.1s ? Container harbor-core        Removed                                                                       0.1s ? Container registry           Removed                                                                       0.1s ? Container redis              Removed                                                                       0.1s ? Container harbor-db          Removed                                                                       0.2s ? Container harbor-log         Removed                                                                      10.1s ? Network harbor_harbor        Removed                                                                       0.1s 
[root@harbor harbor]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@harbor harbor]# docker images
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
goharbor/harbor-exporter        v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon           v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon   v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl     v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon        v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon           v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log             v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice      v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core            v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal          v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db              v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                v2.13.0   2380b5a4f127   4 weeks ago   205MB
  • 編寫服務文件
    為了方便在任意地方都可以啟動服務而不是在 harbor 安裝目錄下,我們需要在/usr/lib/systemd/system/ 目錄下新建 harbor.service 服務啟動文件
# 編寫服務文件(必須有這三個板塊)
[root@harbor harbor]# vim /usr/lib/systemd/system/harbor.service
[root@harbor harbor]# cat /usr/lib/systemd/system/harbor.service
[Unit]	#定義服務啟動的依賴關系和順序、服務的描述信息
Description=Harbor
After=docker.service systemd-networkd.service systemd-resolved.service	# 定義順序:...之后,不是強依賴
Requires=docker.service		#必須先啟動這個服務(強依賴)
Documentation=http://github.com/vmware/harbor[Service]	#定義服務的啟動、停止、重啟
Type=simple	#服務啟動的進程啟動方式
Restart=on-failure	#如果失敗了就重啟
RestartSec=5		#重啟時間
ExecStart=/usr/bin/docker-compose --file /data/harbor/docker-compose.yml up	#啟動時需要執行的指令
# /usr/bin/docker-compose為剛剛安裝的路徑
ExecStop=/usr/bin/docker-compose --file /data/harbor/docker-compose.yml down[Install]
WantedBy=multi-user.target
  • 啟動 Harbor 服務
# 加載服務配置文件
[root@harbor harbor]# systemctl daemon-reload 
# 啟動服務
[root@harbor harbor]# systemctl start harbor
[root@harbor harbor]# docker ps
CONTAINER ID   IMAGE                                 COMMAND                  CREATED         STATUS                            PORTS                                                                                NAMES
337d35f172f5   goharbor/nginx-photon:v2.13.0         "nginx -g 'daemon of…"   4 seconds ago   Up 2 seconds (health: starting)   0.0.0.0:80->8080/tcp, [::]:80->8080/tcp, 0.0.0.0:443->8443/tcp, [::]:443->8443/tcp   nginx
e273b62b677e   goharbor/harbor-jobservice:v2.13.0    "/harbor/entrypoint.…"   4 seconds ago   Up 2 seconds (health: starting)                                                                                        harbor-jobservice
97f335ae1de7   goharbor/harbor-core:v2.13.0          "/harbor/entrypoint.…"   4 seconds ago   Up 2 seconds (health: starting)                                                                                        harbor-core
e076d0a31911   goharbor/redis-photon:v2.13.0         "redis-server /etc/r…"   4 seconds ago   Up 3 seconds (health: starting)                                                                                        redis
8e3182eca5f2   goharbor/harbor-portal:v2.13.0        "nginx -g 'daemon of…"   4 seconds ago   Up 3 seconds (health: starting)                                                                                        harbor-portal
5905e1957d5d   goharbor/harbor-registryctl:v2.13.0   "/home/harbor/start.…"   4 seconds ago   Up 3 seconds (health: starting)                                                                                        registryctl
6da14947a7aa   goharbor/registry-photon:v2.13.0      "/home/harbor/entryp…"   4 seconds ago   Up 3 seconds (health: starting)                                                                                        registry
433cdb7a85bf   goharbor/harbor-db:v2.13.0            "/docker-entrypoint.…"   4 seconds ago   Up 3 seconds (health: starting)                                                                                        harbor-db
81ac5d616d82   goharbor/harbor-log:v2.13.0           "/bin/sh -c /usr/loc…"   4 seconds ago   Up 3 seconds (health: starting)   127.0.0.1:1514->10514/tcp                                                            harbor-log
# 查看服務狀態
[root@harbor ~]# systemctl status harbor
● harbor.service - Harbor
Loaded: loaded (/usr/lib/systemd/system/harbor.service; disabled;
preset: disabled)
Active: active (running) since Wed 2024-08-28 11:57:02 CST; 7s
ago
Docs: http://github.com/vmware/harbor
Main PID: 4478 (docker-compose)
Tasks: 9 (limit: 12115)
Memory: 13.6M
CPU: 95ms
CGroup: /system.slice/harbor.service
└─4478 /usr/bin/docker-compose --file
/data/harbor/docker-compose.yml up
# 設置開機自啟
[root@harbor ~]# systemctl enable harbor
Created symlink /etc/systemd/system/multiuser.target.wants/harbor.service →
/usr/lib/systemd/system/harbor.service.
  • /usr/bin/docker-compose為剛剛安裝的路徑
[root@harbor ~]# cd /data/harbor/
[root@harbor harbor]# ls
common     docker-compose.yml     harbor.yml       install.sh  prepare
common.sh  harbor.v2.13.0.tar.gz  harbor.yml.tmpl  LICENSE     ssl
[root@harbor harbor]# cat docker-compose.yml 
services:log:image: goharbor/harbor-log:v2.13.0container_name: harbor-logrestart: alwayscap_drop:- ALLcap_add:- CHOWN- DAC_OVERRIDE- SETGID- SETUIDvolumes:- /var/log/harbor/:/var/log/docker/:z- type: bindsource: ./common/config/log/logrotate.conftarget: /etc/logrotate.d/logrotate.conf- type: bindsource: ./common/config/log/rsyslog_docker.conftarget: /etc/rsyslog.d/rsyslog_docker.confports:- 127.0.0.1:1514:10514networks:- harborregistry:........registryctl:.....postgresql:.....core:....portal:....jobservice:....redis:....proxy:....
networks:....

八、定制本地倉庫

  • 配置映射
    在 windows 的 hosts 文件中配置 IP 和主機映射。
    “C:\Windows\System32\drivers\etc\hosts”
    192.168.86.20 harbor.registry.com
  • 配置倉庫
    打開瀏覽器,輸入 https://192.168.86.20
    用戶名:admin
    密碼:Harbor12345
    在這里插入圖片描述
    管理界面:
    在這里插入圖片描述

九、測試本地倉庫

  • 拉取鏡像
# 拉取 redis 鏡像
[root@harbor harbor]# docker pull redis:8.0.0
254e724d7786: Pull complete 
cd07ede39ddc: Pull complete 
63df650ee4e0: Pull complete 
c175c1c9487d: Pull complete 
91cf9601b872: Pull complete 
4f4fb700ef54: Pull complete 
c70d7dc4bd70: Pull complete 
Digest: sha256:a4b90e7079b67c41bdf4ca6f9d87197079e4c1c3273b7f489a74f2687d85a05e                                    
Status: Downloaded newer image for redis:8.0.0
docker.io/library/redis:8.0.0# # 拉取 nginx 鏡像
[root@harbor harbor]# docker pull nginx:1.28.0
1.28.0: Pulling from library/nginx
254e724d7786: Already exists 
631d563b4c3a: Pull complete 
42be7bf60a09: Pull complete 
580b83207526: Pull complete 
4b8b35505644: Pull complete 
f196c801e2eb: Pull complete 
6f65eec8b3ab: Pull complete 
Digest: sha256:0ad9e58f00f6a0d92f8c0a2a32285366a0ee948d9f91aee4a2c965a5516c59d5
Status: Downloaded newer image for nginx:1.28.0
docker.io/library/nginx:1.28.0# 拉取 mysql 鏡像
[root@harbor harbor]# docker pull mysql:9.3.0
9.3.0: Pulling from library/mysql
c2eb5d06bfea: Pull complete 
ba361f0ba5e7: Pull complete 
0e83af98b000: Pull complete 
770e931107be: Pull complete 
a2be1b721112: Pull complete 
68c594672ed3: Pull complete 
cfd201189145: Pull complete 
e9f009c5b388: Pull complete 
61a291920391: Pull complete 
c8604ede059a: Pull complete 
Digest: sha256:2247f6d47a59e5fa30a27ddc2e183a3e6b05bc045e3d12f8d429532647f61358
Status: Downloaded newer image for mysql:9.3.0
docker.io/library/mysql:9.3.0[root@harbor harbor]# cd
[root@harbor ~]# docker images
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
redis                           8.0.0     d62dbaef1b81   6 days ago    128MB
nginx                           1.28.0    7e2dd24abce2   2 weeks ago   192MB
mysql                           9.3.0     2c849dee4ca9   3 weeks ago   859MB
goharbor/harbor-exporter        v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon           v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon   v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl     v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon        v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon           v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log             v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice      v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core            v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal          v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db              v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                v2.13.0   2380b5a4f127   4 weeks ago   205MB
  • 鏡像打標簽
    • 給鏡像打標簽,打標簽的格式為:倉庫服務地址/倉庫名稱/鏡像名稱:版本
[root@harbor ~]# docker tag redis:8.0.0 harbor.registry.com/library/redis:8.0.0
[root@harbor ~]# docker tag nginx:1.28.0 harbor.registry.com/library/nginx:1.28.0
[root@harbor ~]# docker images
REPOSITORY                          TAG       IMAGE ID       CREATED       SIZE
redis                               8.0.0     d62dbaef1b81   6 days ago    128MB
harbor.registry.com/library/redis   8.0.0     d62dbaef1b81   6 days ago    128MB
harbor.registry.com/library/nginx   1.28.0    7e2dd24abce2   2 weeks ago   192MB
nginx                               1.28.0    7e2dd24abce2   2 weeks ago   192MB
mysql                               9.3.0     2c849dee4ca9   3 weeks ago   859MB
goharbor/harbor-exporter            v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon               v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon       v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl         v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon            v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon               v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log                 v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice          v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core                v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal              v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db                  v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                    v2.13.0   2380b5a4f127   4 weeks ago   205MB
  • 登錄倉庫
[root@harbor ~]# docker login harbor.registry.com
Username: admin     i Info → A Personal Access Token (PAT) can be used instead.To create a PAT, visit https://app.docker.com/settingsPassword: 		# 此處輸入Harbor12345WARNING! Your credentials are stored unencrypted in '/root/.docker/config.json'.
Configure a credential helper to remove this warning. See
https://docs.docker.com/go/credential-store/Login Succeeded
  • 推送鏡像
    • 將打好標簽的鏡像推送到harbor私有倉庫
# 推送 redis 鏡像
[root@harbor ~]# docker push harbor.registry.com/library/redis:8.0.0
The push refers to repository [harbor.registry.com/library/redis]
ba7ac8bfc794: Pushed 
5f70bf18a086: Pushed 
466ee81cc0c4: Pushed 
275b6714fc25: Pushed 
560e553534a4: Pushed 
183aa91cf85e: Pushed 
6c4c763d22d0: Pushed 
8.0.0: digest: sha256:9918b5032afc54f27539f9ee9ffe465bb04ee362b51219e893763e21d3df835e size: 1776# 推送 nginx 鏡像
[root@harbor ~]# docker push harbor.registry.com/library/nginx:1.28.0
The push refers to repository [harbor.registry.com/library/nginx]
5a905c85a1e6: Pushed 
b6ec55b719dc: Pushed 
50495e2ba6dc: Pushed 
1097e804b7e9: Pushed 
9aa50fe684c5: Pushed 
9f46bafac0d0: Pushed 
6c4c763d22d0: Mounted from library/redis 
1.28.0: digest: sha256:fcfb9e997f1f45b95db849072f3eb8590c84f4fe00a223564bc1ad43d8f26619 size: 1778[root@harbor ~]# ls
anaconda-ks.cfg  busybox_1.0.tar.gz  myapp_1.0.tar.gz  myapp_2.0.tar.gz  randexit_1.0.tar.gz
[root@harbor ~]# 
[root@harbor ~]# 
  • 拉取鏡像
[root@harbor ~]# docker load -i busybox_1.0.tar.gz 
d7f400ce6d52: Loading layer [==================================================>]  1.311MB/1.311MB
5f70bf18a086: Loading layer [==================================================>]  1.024kB/1.024kB
Loaded image: busybox:1.0
[root@harbor ~]# docker load -i myapp_1.0.tar.gz 
36b50b131297: Loading layer [==================================================>]  7.346MB/7.346MB
f19699507d9b: Loading layer [==================================================>]  12.32MB/12.32MB
815f740174b2: Loading layer [==================================================>]   6.65MB/6.65MB
6e0c4635e765: Loading layer [==================================================>]  6.656kB/6.656kB
87148573fd9a: Loading layer [==================================================>]  3.072kB/3.072kB
0987da630a8c: Loading layer [==================================================>]  6.664MB/6.664MB
3fc8ca173d59: Loading layer [==================================================>]  4.608kB/4.608kB
24ceb411aba0: Loading layer [==================================================>]  10.75kB/10.75kB
Loaded image: myapp:1.0
[root@harbor ~]# docker load -i myapp_2.0.tar.gz 
a5ba7c7ae3ae: Loading layer [==================================================>]  84.21MB/84.21MB
1016918def6b: Loading layer [==================================================>]  3.072kB/3.072kB
39e88fb8cafd: Loading layer [==================================================>]   1.79MB/1.79MB
b0d958a2fdf7: Loading layer [==================================================>]  338.4kB/338.4kB
2476cb9a086c: Loading layer [==================================================>]  5.632kB/5.632kB
46dd8f75115d: Loading layer [==================================================>]  12.77MB/12.77MB
bba109905203: Loading layer [==================================================>]  46.08kB/46.08kB
e63054a00258: Loading layer [==================================================>]   2.56kB/2.56kB
ef9ed078ce32: Loading layer [==================================================>]  4.608kB/4.608kB
8625d586caf9: Loading layer [==================================================>]   2.56kB/2.56kB
c83ce901734b: Loading layer [==================================================>]  4.096kB/4.096kB
5f70bf18a086: Loading layer [==================================================>]  1.024kB/1.024kB
Loaded image: myapp:2.0
[root@harbor ~]# docker load -i randexit_1.0.tar.gz 
8d3ac3489996: Loading layer [==================================================>]  5.866MB/5.866MB
3c2b5486050b: Loading layer [==================================================>]   1.97MB/1.97MB
Loaded image: randexit:1.0
[root@harbor ~]# docker images
REPOSITORY                          TAG       IMAGE ID       CREATED       SIZE
harbor.registry.com/library/redis   8.0.0     d62dbaef1b81   6 days ago    128MB
redis                               8.0.0     d62dbaef1b81   6 days ago    128MB
myapp                               1.0       e4ac4394936f   9 days ago    31.4MB
randexit                            1.0       31dab2fa7183   11 days ago   9.52MB
busybox                             1.0       6a7beaa1d311   11 days ago   1.11MB
myapp                               2.0       9ab797c41790   11 days ago   95.5MB
nginx                               1.28.0    7e2dd24abce2   2 weeks ago   192MB
harbor.registry.com/library/nginx   1.28.0    7e2dd24abce2   2 weeks ago   192MB
mysql                               9.3.0     2c849dee4ca9   3 weeks ago   859MB
goharbor/harbor-exporter            v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon               v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon       v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl         v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon            v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon               v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log                 v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice          v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core                v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal              v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db                  v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                    v2.13.0   2380b5a4f127   4 weeks ago   205MB
[root@harbor ~]# docker tag myapp:1.0 harbor.registry.com/library/myapp:1.0
[root@harbor ~]# docker tag myapp:2.0 harbor.registry.com/library/myapp:2.0
[root@harbor ~]# docker tag randexit:1.0 harbor.registry.com/library/randexit:1.0
[root@harbor ~]# docker tag busybox:1.0 harbor.registry.com/library/busybox:1.0
[root@harbor ~]# docker images
REPOSITORY                             TAG       IMAGE ID       CREATED       SIZE
redis                                  8.0.0     d62dbaef1b81   6 days ago    128MB
harbor.registry.com/library/redis      8.0.0     d62dbaef1b81   6 days ago    128MB
myapp                                  1.0       e4ac4394936f   9 days ago    31.4MB
harbor.registry.com/library/myapp      1.0       e4ac4394936f   9 days ago    31.4MB
randexit                               1.0       31dab2fa7183   11 days ago   9.52MB
harbor.registry.com/library/randexit   1.0       31dab2fa7183   11 days ago   9.52MB
busybox                                1.0       6a7beaa1d311   11 days ago   1.11MB
harbor.registry.com/library/busybox    1.0       6a7beaa1d311   11 days ago   1.11MB
myapp                                  2.0       9ab797c41790   11 days ago   95.5MB
harbor.registry.com/library/myapp      2.0       9ab797c41790   11 days ago   95.5MB
nginx                                  1.28.0    7e2dd24abce2   2 weeks ago   192MB
harbor.registry.com/library/nginx      1.28.0    7e2dd24abce2   2 weeks ago   192MB
mysql                                  9.3.0     2c849dee4ca9   3 weeks ago   859MB
goharbor/harbor-exporter               v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon                  v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon          v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl            v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon               v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon                  v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log                    v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice             v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core                   v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal                 v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db                     v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                       v2.13.0   2380b5a4f127   4 weeks ago   205MB
[root@harbor ~]# docker push harbor.registry.com/library/myapp:1.0
The push refers to repository [harbor.registry.com/library/myapp]
24ceb411aba0: Pushed 
3fc8ca173d59: Pushed 
0987da630a8c: Pushed 
87148573fd9a: Pushed 
6e0c4635e765: Pushed 
815f740174b2: Pushed 
f19699507d9b: Pushed 
36b50b131297: Pushed 
1.0: digest: sha256:f9132f778905888fce4d3b691c4e67afa963e417786e308969ef745666ae2bd1 size: 1990
[root@harbor ~]# docker push harbor.registry.com/library/myapp:2.0
The push refers to repository [harbor.registry.com/library/myapp]
5f70bf18a086: Mounted from library/redis 
c83ce901734b: Pushed 
8625d586caf9: Pushed 
ef9ed078ce32: Pushed 
e63054a00258: Pushed 
bba109905203: Pushed 
46dd8f75115d: Pushed 
2476cb9a086c: Pushed 
b0d958a2fdf7: Pushed 
39e88fb8cafd: Pushed 
1016918def6b: Pushed 
a5ba7c7ae3ae: Pushed 
2.0: digest: sha256:61f2d1cb8f35566d03900aeeb798dd04625a7f2502db467c4325d4677a78953d size: 2814
[root@harbor ~]# docker push harbor.registry.com/library/randexit:1.0
The push refers to repository [harbor.registry.com/library/randexit]
3c2b5486050b: Pushed 
8d3ac3489996: Pushed 
1.0: digest: sha256:08376ae8aa4f3762701d638066a3f8445d47a871883016fd43cce8fdbb2cfbe9 size: 950
[root@harbor ~]# docker push harbor.registry.com/library/busybox:1.0
The push refers to repository [harbor.registry.com/library/busybox]
5f70bf18a086: Mounted from library/myapp 
d7f400ce6d52: Pushed 
1.0: digest: sha256:31df394c7ec2260c73f50bdd619c25a85b03a393e7f87db6a5df2041673930fb size: 733
[root@harbor ~]# docker images
REPOSITORY                             TAG       IMAGE ID       CREATED       SIZE
redis                                  8.0.0     d62dbaef1b81   6 days ago    128MB
harbor.registry.com/library/redis      8.0.0     d62dbaef1b81   6 days ago    128MB
harbor.registry.com/library/myapp      1.0       e4ac4394936f   9 days ago    31.4MB
myapp                                  1.0       e4ac4394936f   9 days ago    31.4MB
randexit                               1.0       31dab2fa7183   11 days ago   9.52MB
harbor.registry.com/library/randexit   1.0       31dab2fa7183   11 days ago   9.52MB
busybox                                1.0       6a7beaa1d311   11 days ago   1.11MB
harbor.registry.com/library/busybox    1.0       6a7beaa1d311   11 days ago   1.11MB
myapp                                  2.0       9ab797c41790   11 days ago   95.5MB
harbor.registry.com/library/myapp      2.0       9ab797c41790   11 days ago   95.5MB
harbor.registry.com/library/nginx      1.28.0    7e2dd24abce2   2 weeks ago   192MB
nginx                                  1.28.0    7e2dd24abce2   2 weeks ago   192MB
mysql                                  9.3.0     2c849dee4ca9   3 weeks ago   859MB
goharbor/harbor-exporter               v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon                  v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon          v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl            v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon               v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon                  v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log                    v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice             v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core                   v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal                 v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db                     v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                       v2.13.0   2380b5a4f127   4 weeks ago   205MB
[root@harbor ~]# docker tag mysql:9.3.0 harbor.registry.com/library/mysql:9.3.0
[root@harbor ~]# docker push harbor.registry.com/library/mysql:9.3.0
The push refers to repository [harbor.registry.com/library/mysql]
f5e36b0f4d12: Pushed 
d619ee1b5c20: Pushed 
133ce0df5d7c: Pushed 
e1c1cbc5e82d: Pushed 
510a7371e11f: Pushed 
bdcd7807cb3e: Pushed 
ee80289a1f0f: Pushed 
a655f286e2fd: Pushed 
6fbd0dc178dd: Pushed 
30cef8a08884: Pushed 
9.3.0: digest: sha256:242c70430703dd27b3a0fcfa628368d165510a5867f20a9beb62f6036879bcf8 size: 2412
[root@harbor ~]# docker images
REPOSITORY                             TAG       IMAGE ID       CREATED       SIZE
redis                                  8.0.0     d62dbaef1b81   6 days ago    128MB
harbor.registry.com/library/redis      8.0.0     d62dbaef1b81   6 days ago    128MB
myapp                                  1.0       e4ac4394936f   9 days ago    31.4MB
harbor.registry.com/library/myapp      1.0       e4ac4394936f   9 days ago    31.4MB
randexit                               1.0       31dab2fa7183   11 days ago   9.52MB
harbor.registry.com/library/randexit   1.0       31dab2fa7183   11 days ago   9.52MB
busybox                                1.0       6a7beaa1d311   11 days ago   1.11MB
harbor.registry.com/library/busybox    1.0       6a7beaa1d311   11 days ago   1.11MB
myapp                                  2.0       9ab797c41790   11 days ago   95.5MB
harbor.registry.com/library/myapp      2.0       9ab797c41790   11 days ago   95.5MB
nginx                                  1.28.0    7e2dd24abce2   2 weeks ago   192MB
harbor.registry.com/library/nginx      1.28.0    7e2dd24abce2   2 weeks ago   192MB
harbor.registry.com/library/mysql      9.3.0     2c849dee4ca9   3 weeks ago   859MB
mysql                                  9.3.0     2c849dee4ca9   3 weeks ago   859MB
goharbor/harbor-exporter               v2.13.0   0be56feff492   4 weeks ago   127MB
goharbor/redis-photon                  v2.13.0   7c0d9781ab12   4 weeks ago   166MB
goharbor/trivy-adapter-photon          v2.13.0   f2b4d5497558   4 weeks ago   381MB
goharbor/harbor-registryctl            v2.13.0   bbd957df71d6   4 weeks ago   162MB
goharbor/registry-photon               v2.13.0   fa23989bf194   4 weeks ago   85.9MB
goharbor/nginx-photon                  v2.13.0   c922d86a7218   4 weeks ago   151MB
goharbor/harbor-log                    v2.13.0   463b8f469e21   4 weeks ago   164MB
goharbor/harbor-jobservice             v2.13.0   112a1616822d   4 weeks ago   174MB
goharbor/harbor-core                   v2.13.0   b90fcb27fd54   4 weeks ago   197MB
goharbor/harbor-portal                 v2.13.0   858f92a0f5f9   4 weeks ago   159MB
goharbor/harbor-db                     v2.13.0   13a2b78e8616   4 weeks ago   273MB
goharbor/prepare                       v2.13.0   2380b5a4f127   4 weeks ago   205MB






本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/905190.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/905190.shtml
英文地址,請注明出處:http://en.pswp.cn/news/905190.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

關于高并發GIS數據處理的一點經驗分享

1、背景介紹 筆者過去幾年在參與某個大型央企的項目開發過程中,遇到了十分棘手的難題。其與我們平常接觸的項目性質完全不同。在一般的項目中,客戶一般只要求我們能夠通過桌面軟件對原始數據進行加工處理,將各類地理信息數據加工處理成地圖/場景和工作空間,然后再將工作空…

使用 DMM 測試 TDR

TDR&#xff08;時域反射計&#xff09;可能是實驗室中上升時間最快的儀器&#xff0c;但您可以使用直流歐姆表測試其準確性。 TDR 測量什么 在所有高速通道中&#xff0c;反射都很糟糕。我們嘗試設計一個通道來減少反射&#xff0c;這些反射都會導致符號間干擾 &#xff08;…

可視化圖解算法37:序列化二叉樹-II

1. 題目 描述 請實現兩個函數&#xff0c;分別用來序列化和反序列化二叉樹&#xff0c;不對序列化之后的字符串進行約束&#xff0c;但要求能夠根據序列化之后的字符串重新構造出一棵與原二叉樹相同的樹。 二叉樹的序列化(Serialize)是指&#xff1a;把一棵二叉樹按照某種遍…

【Python】Python常用數據類型詳解

Python常用數據類型詳解:增刪改查全掌握 Python作為一門簡潔高效的編程語言,其豐富的數據類型是構建程序的基礎。本文將詳細介紹數字、字符串、列表、元組、字典、集合這六種核心數據類型的特點及增刪改查操作,并附代碼示例,助你全面掌握數據操作技巧。 一、數字(Number)…

模板引用、組件基礎

#### 組件基礎 1. 定義和使用簡單組件 - ![alt text](./img/image-2.png) vue <!-- 在App.vue里 --> <script setup>import HelloWorld from ./components/HelloWorld.vue </script> <template><HelloWorld></HelloWorld></temp…

深入探索 RKNN 模型轉換之旅

在人工智能蓬勃發展的當下&#xff0c;邊緣計算領域的應用愈發廣泛。瑞芯微的 RKNN 技術在這一領域大放異彩&#xff0c;它能讓深度學習模型在其芯片平臺上高效運行。而在整個應用流程中&#xff0c;模型轉換是極為關鍵的一環&#xff0c;今天就讓我們一同深入這個神奇的 RKNN …

iframe嵌套網站的安全機制實現

背景&#xff1a; 公司內部有一套系統A部署在內網&#xff0c;這套系統嵌套了B網站&#xff08;也是內網&#xff09;&#xff0c;只有內網才能訪問。現在需要將這個A系統暴露到公網。B系統的安全策略比較低&#xff0c;想快速上線并提高B系統的安全性。 通過 Nginx 代理層 設置…

青少年編程與數學 02-019 Rust 編程基礎 08課題、字面量、運算符和表達式

青少年編程與數學 02-019 Rust 編程基礎 08課題、字面量、運算符和表達式 一、字面量1. 字面量的分類1.1 整數字面量1.2 浮點數字面量1.3 字符字面量1.4 字符串字面量1.5 布爾字面量1.6 字節數組字面量 2. 字面量的類型推斷3. 字面量的用途4. 字面量的限制字面量總結 二、運算符…

危化品安全員職業發展方向的優劣對比

以下是危化品安全員不同職業發展方向的優劣對比&#xff1a; 縱向晉升 優勢 職業路徑清晰&#xff1a;從危化品安全員逐步晉升為安全主管、安全經理、安全總監等管理職位&#xff0c;層級明確&#xff0c;有較為清晰的上升通道。管理能力提升&#xff1a;隨著職位上升&#x…

談AI/OT 的融合

過去的十幾年間&#xff0c;工業界討論最多的話題之一就是IT/OT 融合&#xff0c;現在&#xff0c;我們不僅要實現IT/OT 的融合&#xff0c;更要面向AI/OT 的融合。看起來不太靠譜&#xff0c;卻留給我們無限的想象空間。OT 領域的專家們不要再當“九斤老太”&#xff0c;指責這…

計算機網絡核心技術解析:從基礎架構到應用實踐

計算機網絡作為現代信息社會的基石&#xff0c;承載著全球數據交換與資源共享的核心功能。本文將從網絡基礎架構、核心協議、分層模型到實際應用場景&#xff0c;全面解析計算機網絡的核心技術&#xff0c;并結合行業最新趨勢&#xff0c;為讀者構建系統的知識體系。 一、計算機…

大規模數據并行排序策略(Parallel Sample Sort)

大規模數據并行排序策略 對于上億條大型記錄的并行排序&#xff0c;基于MPI的多節點環境&#xff0c;可以采用以下策略來充分利用內存和網絡資源&#xff1a; 推薦算法&#xff1a;樣本排序(Sample Sort) 樣本排序是大規模并行排序的高效算法&#xff0c;特別適合MPI環境&am…

o.redisson.client.handler.CommandsQueue : Exception occured. Channel

1&#xff0c; 版本 <dependency><groupId>org.redisson</groupId><artifactId>redisson</artifactId><version>2.15.2</version> </dependency>2&#xff0c;問題 2025-05-12 10:46:47.436 ERROR 27780 --- [sson-netty-5-…

Kotlin跨平臺Compose Multiplatform實戰指南

Kotlin Multiplatform&#xff08;KMP&#xff09;結合 Compose Multiplatform 正在成為跨平臺開發的熱門選擇&#xff0c;它允許開發者用一套代碼構建 Android、iOS、桌面&#xff08;Windows/macOS/Linux&#xff09;和 Web 應用。以下是一個實戰指南&#xff0c;涵蓋核心概念…

【Jenkins簡單自動化部署案例:基于Docker和Harbor的自動化部署流程記錄】

摘要 本文記錄了作者使用Jenkins時搭建的一個簡單自動化部署案例&#xff0c;涵蓋Jenkins的Docker化安裝、Harbor私有倉庫配置、Ansible遠程部署等核心步驟。通過一個SpringBoot項目 (RuoYi) 的完整流程演示&#xff0c;從代碼提交到鏡像構建、推送、滾動更新&#xff0c;逐步實…

【Git】GitHub上傳圖片遇到的問題

一開始我直接在網頁上拖拽上傳&#xff0c;會說“網頁無法正常運作”。 采用git push上去&#xff1a; git clone https://github.com/your-username/your-repo-name.git cd your-repo-name git add . git commit -m "Add large images" git push origin main報錯&…

【落羽的落羽 C++】stack和queue、deque、priority_queue、仿函數

文章目錄 一、stack和queue1. 概述2. 使用3. 模擬實現 二、deque三、priority_queue1. 概述和使用2. 模擬實現 四、仿函數 一、stack和queue 1. 概述 我們之前學習的vector和list&#xff0c;以及下面要認識的deque&#xff0c;都屬于STL的容器&#xff08;containers&#x…

用生活例子通俗理解 Python OOP 四大特性

讓我們用最生活化的方式&#xff0c;結合Python代碼&#xff0c;來理解面向對象編程的四大特性。 1. 封裝&#xff1a;像使用自動售貨機 生活比喻&#xff1a; 你只需要投幣、按按鈕&#xff0c;就能拿到飲料 不需要知道機器內部如何計算找零、如何運送飲料 如果直接打開機…

軟件安全(三)實現后門程序

如下是一個經典的后門程序 #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 #include<WinSock2.h> #include<windows.h> #include<iostream> #pragma comment(lib, "ws2_32.lib")int main() {//初始化網絡環境WSADATA wsaData;int result WSAStartup…

深入理解高性能網絡通信:從內核源碼到云原生實踐

深入理解高性能網絡通信&#xff1a;從內核源碼到云原生實踐 前言 隨著互聯網業務規模的高速增長&#xff0c;服務端網絡通信能力成為系統性能的核心瓶頸。如何支撐百萬級連接、在極限場景下實現低延遲高吞吐&#xff1f;本篇博客將圍繞Linux通信機制內核剖析、性能調優實戰、…