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
相关文章:
Docker-配置私有仓库(Harbor)
配置私有仓库(Harbor) 一、环境准备安装 Docker 三、安装docker-compose四、准备Harbor五、配置证书六、部署配置Harbor七、配置启动服务八、定制本地仓库九、测试本地仓库 Harbor(港湾),是一个用于 存储 和 分发 Docker 镜像的企业级 Regi…...
1.5 连续性与导数
一、连续性的底层逻辑(前因) 为什么需要研究连续性? 数学家在研究函数图像时发现两类现象:有些函数能用一笔画完不断开(如抛物线),有些则会出现"断崖"“跳跃"或"无底洞”&a…...
Day22打卡-复习
复习日 仔细回顾一下之前21天的内容,没跟上进度的同学补一下进度。 作业: 自行学习参考如何使用kaggle平台,写下使用注意点,并对下述比赛提交代码 泰坦尼克号人员生还预测https://www.kaggle.com/competitions/titanic/overview K…...
配置Hadoop集群环境准备
(一)Hadoop的运行模式 一共有三种: 本地运行。伪分布式完全分布式 (二)Hadoop的完全分布式运行 要模拟这个功能,我们需要做好如下的准备。 1)准备3台客户机(关闭防火墙、静态IP、…...
HTTPS全解析:从证书签发到TLS握手优化
HTTPS(超文本传输安全协议 本质上是HTTP的安全版本。标准的HTTP协议仅规范了客户端与服务器之间的通信格式,但所有数据传输都是明文的,容易被中间人窃听和篡改。HTTPS通过加密传输数据解决了这一安全问题。 HTTPS可以理解为"HTTPTLS/SS…...
#将一个 .c 文件转变为可直接运行的文件过程及原理
将一个 .c 文件(C语言源代码)转变为可直接运行的可执行文件,涉及从源代码到机器码的编译和链接过程。以下是详细的过程与原理,分为步骤说明: 一、总体流程 .c 文件到可执行文件的过程通常包括以下几个阶段:…...
【软件学习】GeneMiner 2:系统发育基因组学的一体化全流程分析工具
【软件学习】GeneMiner 2—— 系统发育基因组学的一体化全流程分析工具 文章目录 【软件学习】GeneMiner 2—— 系统发育基因组学的一体化全流程分析工具前言一、软件了解二、软件安装三、软件使用示例演示3.1 快速掌握使用方法3.2 获取质体基因组和质体基因3.3 单拷贝基因建树…...
聊一聊AI对接口测试的潜在影响有哪些?
目录 一、 自动化测试用例生成 二、 缺陷预测与根因分析 三、自适应测试维护 四、实时监控与自适应优化 五、 性能与安全测试增强 六、测试结果分析与报告 七、持续测试与DevOps集成 八、挑战与局限性 九、未来趋势 使用AI可以自动化测试用例生成、异常检测、结果分析…...
wordcount在mapreduce的例子
1.启动集群 2.创建项目 项目结构为: 3.pom.xml文件为 <project xmlns"http://maven.apache.org/POM/4.0.0" xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation"http://maven.apache.org/POM/4.0.0 http://mave…...
CSS3 遮罩
在网页设计中,我们经常需要实现一些特殊的视觉效果来增强用户体验。CSS3 遮罩(mask)允许我们通过控制元素的可见区域来创建各种精美的视觉效果。本文将带你全面了解 CSS3 遮罩的功能和应用。 什么是 CSS3 遮罩? CSS3 遮罩是一种…...
HTTP协议解析:Session/Cookie机制与HTTPS加密体系的技术演进(一)
一.HTTP协议 我们上篇文章已经提到了对于自定义协议的序列化与反序列化。那么有没有什么比较成熟的,大佬们写的应用层协议,供我们参考使用呢?HTTP(超文本传输协议)就是其中之一。 在互联网世界中, HTTP(HyperText Transfer Prot…...
Matlab 234-锂电池充放电仿真
1、内容简介 Matlab 234-锂电池充放电仿真 可以交流、咨询、答疑 2、内容说明 略 锂离子电池已经广泛应用于我国目前电子产品市场,当下手机市场和新能源市场对于锂离子电池的大量需求,推动了锂离子电池的发展,我国已经成为世界上锂离子电池…...
std::move 和 std::forward
关联点 都是执行转换(cast)的函数(函数模板),不产生任何可执行代码。且都可以把实参转换成右值。 std::move无条件将实参(const除外 )转换成右值引用,std::forward 条件返回右值引用 _EXPORT_STD template…...
工业协议跨界实录:零基础玩转PROFINET转EtherCAT主站智能网关
工业自动化领域的金字塔就是工业通信行业,用的最多的便是协议转换模块,通俗来说,网关就像一个“语言翻译器”,能把一种通信语言转换成另一种,满足实际通信需求,还能保护投资。PROFINET 转EtherCAT 网关WL-P…...
开源链动2+1模式AI智能名片S2B2C商城小程序赋能新微商服务能力升级研究
摘要:本文聚焦新微商服务能力升级路径,探讨开源链动21模式、AI智能名片与S2B2C商城小程序在重构培训体系、激励机制及用户服务中的协同作用。研究显示,新微商通过“技术赋能-机制创新-服务深化”三维变革,将传统微商的“产品压货”…...
vue3配置element-ui的使用
今天阐述一下如何在vue中进行配置使用element-ui; 一,配置下载Element 1.首页在电脑上下载好vue,以及npm,可以去相关的官方进行下载。 2.进行配置命令 npm install element-plus --save如报错: npm error code ERE…...
39-绘制渐变的文字
39-绘制渐变的文字_哔哩哔哩_bilibili39-绘制渐变的文字是一次性学会 Canvas 动画绘图(核心精讲50个案例)2023最新教程的第40集视频,该合集共计53集,视频收藏或关注UP主,及时了解更多相关视频内容。https://www.bilibi…...
HBase进阶之路:从原理到实战的深度探索
目录 一、HBase 核心概念再梳理 1.1 RowKey 1.2 Column Family 1.3 Region 二、架构与运行机制剖析 2.1 架构组件详解 2.1.1 Client 2.1.2 Zookeeper 2.1.3 Master 2.1.4 RegionServer 2.1.5 HDFS 2.2 数据读写流程深度解析 2.2.1 数据写入流程 2.2.2 数据读取流…...
使用 AddressSanitizer 检测栈内存越界错误
一、概述 在 C/C 编程中,栈内存越界 是一种常见而危险的内存错误,通常发生在局部变量数组被访问时索引越界。由于栈空间的结构特点,越界写入可能覆盖返回地址或其他局部变量,导致不可预测的行为甚至程序崩溃。传统的调试手段难以定…...
【技巧】离线安装docker镜像的方法
回到目录 【技巧】离线安装docker镜像的方法 0. 为什么需要离线安装? 第一、 由于docker hub被墙,所以 拉取镜像需要配置国内镜像源 第二、有一些特殊行业服务器无法接入互联网,需要手工安装镜像 1. 可以正常拉取镜像服务器操作 服务器…...
vue实现与后台springboot传递数据【传值/取值 Axios 】
vue实现与后台springboot传递数据【传值/取值】 提示:帮帮志会陆续更新非常多的IT技术知识,希望分享的内容对您有用。本章分享的是node.js和vue的使用。前后每一小节的内容是存在的有:学习and理解的关联性。【帮帮志系列文章】:每…...
Git日志信息
Git日志信息 1. log log 命令用于查看 git 的各种日志信息,在使用 log 后,git 会进入 vim 模式,此时退出日志模式需要按下 q 键。可以通过小箭头来浏览未显示出来的内容。 1.1 查看日志信息 git log git log --prettyoneline #美观输出日…...
Linux操作系统从入门到实战(六)Linux开发工具(上)详细介绍什么是软件包管理器,Linux下如何进行软件和软件包的安装、升级与卸载
Linux操作系统从入门到实战(六)Linux开发工具(上)详细介绍什么是软件包管理器,Linux下如何进行软件和软件包的安装、升级与卸载 前言一、 软件包管理器1.1 传统安装方式的麻烦:从源代码说起1.2 软件包&…...
Java中的策略模式和模板方法模式
文章目录 1. 策略模式(Strategy Pattern)案例:支付方式选择 2. 模板方法模式(Template Method Pattern)案例:制作饮料流程 3. 策略模式 vs 模板方法模式4.总结 在Java中,策略模式和模板方法模式…...
C#里WPF使用触发器实现鼠标点击响应
在WPF里创建了一个自定义的用户控件, 要想在这个控件里实现鼠标的点击事件响应, 就需要添加事件触发器交互定义,如下代码: <ListView x:Name="ListViewMenu" ItemsSource="{Binding Path=SubItems}" Foreground="White" ScrollViewer.Ho…...
tensorflow-cpu
python3.8~3.12安装tensorflow-cpu 准备 创建并进入目录 mkdir tf-cpu cd tf-cpu编写测试代码 test_tensorflow.py import tensorflow as tf# 检查TensorFlow版本 print("\nTensorFlow version:", tf.__version__,end\n\n)# 创建一个简单的计算图并运行它 tensor …...
【AI提示词】PEST分析
提示说明 市场分析师专注于为企业、产品或国家提供PEST分析支持,以制定精准的市场战略。 提示词 # Role: PEST分析## Profile - language: 中文 - description: 市场分析师专注于为企业、产品或国家提供PEST分析支持,以制定精准的市场战略 - backgrou…...
42、在.NET 中能够将⾮静态的⽅法覆写成静态⽅法吗?
在.NET中,不能将非静态方法(实例方法)直接覆写(Override)为静态方法(Static Method)。以下是关键原因和解释: 1. 方法绑定的本质区别 实例方法:属于对象的实例…...
【嵌入式系统设计师(软考中级)】第三章:嵌入式系统软件基础知识——①软件及操作系统基础
文章目录 1. 嵌入式系统软件基础知识1.1 嵌入式软件分类1.2 嵌入式系统初始化1.3 无操作系统支持的嵌入式软件体系结构1.4 有操作系统支持的嵌入式软件体系结构1.5 嵌入式支撑软件 2. 嵌入式操作系统基础知识2.1 嵌入式操作系统基本概念2.2 处理器管理2.2.1 多道程序2.2.2 分区…...
cs224w课程学习笔记-第11课
cs224w课程学习笔记-第11课 知识图谱嵌入 前言一、知识图谱1、知识图谱特点2、关系类型 二、知识图谱嵌入1、嵌入核心思想2、嵌入模型2.1 嵌入模型transE1)、核心思想2)、训练步骤3)、模型表征能力 2.2 嵌入模型TransR2.3 DistMult嵌入模型1)、核心思想2)、表征能力 2.4 complE…...
5.10-套接字通信 - C++
套接字通信 1.1 通信效率问题 服务器端 单线程 / 单进程 无法使用,不支持多客户端 多线程 / 多进程 写程序优先考虑多线程:什么时候考虑多进程? 启动了一个可执行程序 A ,要在 A 中启动一个可执行程序 B 支持多客户端连接 IO 多…...
【Linux】Linux内核的网络协议之socket理解
1. Socket(套接字) 的本质 它是应用程序与网络协议栈之间的编程接口(API),用于实现网络通信。 Socket 并不是一个物理设备,而是一个抽象层为应用程序提供统一的网络操作接口(如 send()、recv()…...
仿函数和函数对象
1. 概念解读:什么是“函数”和“函数对象”? 核心概念一句话总结 仿函数(Functor) 函数对象(Function Object) 它们本质是一个对象(Object),但可以像函数(Fu…...
Kubernetes控制平面组件:Kubelet 之 Static 静态 Pod
云原生学习路线导航页(持续更新中) kubernetes学习系列快捷链接 Kubernetes架构原则和对象设计(一)Kubernetes架构原则和对象设计(二)Kubernetes架构原则和对象设计(三)Kubernetes控…...
Django 项目的 models 目录中,__init__.py 文件的作用
在 Django 项目的models/init.py文件中,这些导入语句的主要作用是将各个模型类从不同的模块中导入到models包的命名空间中。这样做有以下几个目的: 简化导入路径 当你需要在项目的其他地方使用这些模型时,可以直接从models包导入,…...
学习日志04 java
PTA上的练习复盘 java01 编程题作业感悟: 可以用ai指导自己怎么调试,但是不要把调代码这过程里面的精华交给ai,就是自己去修正错误不能让ai代劳!~~~ 1 scanner.close() Scanner *** new Scanner(System.in); ***.close(); …...
vue-pdf-embed预览PDF
一、vue-pdf-embed 链接:Yarn 1、安装插件 npm install vue-pdf-embed 2、文件中引入(分页效果已实现,样式请自行修改) <template><div class"download-pdf-preview" style"height: 450px; border:1…...
C++GO语言微服务之Dockerfile docker-compose
目录 01 01-知识点概述 02 02-dockerfile复习 03 03-环境变量ENV的使用 04 04-WORKDIR的使用 05 05-USER和ARG的使用 06 06-ONBUILD的使用 07 07-dockerfile的缓存相关的参数 08 08-dockerfile的编写 09 09-测试-没成功-好像是网不行 01 10-docker-compose介绍 02 11…...
【漫话机器学习系列】255.独立同分布(Independent and Identically Distributed,简称 IID)
深入理解独立同分布(IID):机器学习与统计学的基石 在机器学习、深度学习、统计建模等领域,我们经常会遇到一个重要假设:独立同分布(Independent and Identically Distributed,简称 IID…...
树莓派4 yolo 11l.pt性能优化后的版本
树莓派4 使用 Picamera2 拍摄图像,然后通过 YOLO11l.pt 进行目标检测,并在实时视频流中显示结果。但当前的代码在运行时可能会比较卡顿,主要原因包括: picam2.capture_array() 是一个较慢的操作;YOLO 推理可能耗时较长…...
AD22 快速定义PCB板框与DXF导入定义
自行定义板框 1. 初步评估:选中所有的器件,选中‘在矩形区域排列’ 将元件放好后,可以再将元件紧凑一下 2. 设置原点,并在下方选中机械一层 从原点出发,点击快捷键PL 画框线 3. 对线条长度取整,且最好是5…...
LInux系统文件与目录管理(二)
提示:第二部分对第一部分收尾 文章目录 常见的命令如下一、文件查看命令1. more命令2.less命令3.head命令4.tail命令5.nl命令(了解)6.创建目录命令7.创建文件命令>: 覆盖重定向>>: 追加重定向 8.touch命令9.echo命令10.文件或目录复…...
Redisson在业务处理中失败后的应对策略:保障分布式系统的可靠性
分布式系统中的数据一致性与高可用性一直是开发者面临的难题。作为Redis官方推荐的Java客户端,Redisson凭借其强大的分布式能力成为解决这些问题的利器。但在实际业务场景中,网络抖动、资源竞争、节点故障等问题可能导致操作失败,本文将深入探…...
windows下docker 运行 ros2humble arm64
目前要想运行arm版ros humble 目前最好的解决方案是使用qemu模拟。 1.拉取 ubuntu22.04 docker pull ubuntu:22.04 --platformarm642.安装小鱼ros2 humble wget http://fishros.com/install -O fishros && . fishros3.安装eqmu docker run --rm --privileged multia…...
表的增删改查 -- 2
目录 3、查询(R) 3.7、条件查询:where 3.8、分页查询:limit 3.9、查询总结 4、修改(U) 5、删除(D) 3、查询(R) 3.7、条件查询:where selec…...
Linux系统管理与编程20:Apache
兰生幽谷,不为莫服而不芳; 君子行义,不为莫知而止休。 做好网络和yum配置,用前面dns规划的www的IP进行。 #!/bin/bash #----------------------------------------------------------- # File Name: myWeb.sh # Version: 1.0 # …...
dfs 第一次加训 详解 下
目录 P1706 全排列问题 思路 B3618 寻找团伙 思路 B3621 枚举元组 思路 B3622 枚举子集(递归实现指数型枚举) 思路 B3623 枚举排列(递归实现排列型枚举) B3625 迷宫寻路 思路 P6183 [USACO10MAR] The Rock Game S 总结…...
vue2/3 中使用 @vue-office/docx 在网页中预览(docx、excel、pdf)文件
1. 安装依赖: #docx文档预览组件npm install vue-office/docx vue-demi0.14.6#excel文档预览组件npm install vue-office/excel vue-demi0.14.6#pdf文档预览组件npm install vue-office/pdf vue-demi0.14.6 vue2.6版本或以下还需要额外安装 vue/composition-api …...
Excel表的导入与导出
Excel表的导入与导出 根据excel表来建立所需的数据库表格 <dependency><groupId>com.auth0</groupId><artifactId>java-jwt</artifactId><version>3.10.3</version></dependency><dependency><groupId>cn.hutool&…...
Redis 中常见的数据类型有哪些?
Redis 常见的数据类型包括 5 种基础类型(String、Hash、List、Set、Zset)和 3 种特殊类型(HyperLogLog、Bitmap、Geospatial)。以下是详细说明: 一、5 种基础数据类型 1. 字符串(String) 特点…...