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.mzph.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通信机制内核剖析、性能调优实战、…