1. 环境说明
操作系统:openEuler 22.03
软件版本:harbor 2.10.3
2. Harbor软件安装
2.1 安装前准备
# systemctl disable firewalld.service
# systemctl stop firewalld.service
# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
# setenforce 0
# hostnamectl --static set-hostname harbor.test.local
安装docker-ce,再次不熬述
2.2 下载解压harbor
# wget https://github.com/goharbor/harbor/releases/download/v2.10.3/harbor-offline-installer-v2.10.3.tgz
# mkdir /opt/software
# tar -xvf harbor-offline-installer-v2.10.3.tgz -C /opt/software
2.3 安装docker compose
# curl -L https://github.com/docker/compose/releases/download/2.28.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
# docker-compose --version
Docker Compose version 2.28.1
2.4 生成ssl证书文件
# mkdir {harbor安装路径}/cert && cd {harbor安装路径}/cert
# openssl genrsa -out harbor-ca.key 4096
# openssl req -x509 -new -nodes -sha512 -days 36500 \
-subj "/C=CN/ST=Beijing/L=Beijing/O=harbor/OU=harbor-CNPC/CN=harbor.test.local" \
-key harbor-ca.key \
-out harbor-ca.crt
# openssl genrsa -out harbor.test.local.key 4096
# openssl req -sha512 -new \
-subj "/C=CN/ST=Beijing/L=Beijing/O=harbor/OU=harbor-CNPC/CN=harbor.test.local" \
-key harbor.test.local.key \
-out harbor.test.local.csr
# 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.test.local
DNS.3=harbor.test.local
EOF
# openssl x509 -req -sha512 -days 36500 \
-extfile v3.ext \
-CA harbor-ca.crt -CAkey harbor-ca.key -CAcreateserial \
-in harbor.test.local.csr \
-out harbor.test.local.crt
# openssl x509 -inform PEM -in harbor.test.local.crt -out harbor.test.local.cert
2.5 修改harbor配置文件
# cp /opt/software/harbor/harbor.yml.tmpl /opt/software/harbor/harbor.yml
# vi /opt/software/harbor/harbor.yml
hostname: harbor.test.local
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: {harbor http端口}
# https related config
https:
# https port for harbor, default is 443
port: {harbor https端口}
# The path of cert and key files for nginx
certificate: /opt/harbor/cert/harbor.test.local.crt
private_key: /opt/hatbor/cert/harbor.test.local.key
harbor_admin_password: {harbor登录密码}
database:
# The password for the root user of Harbor DB. Change this before any production use.
password: {harbor数据库登录密码}
data_volume: /opt/harbor/data
2.6 安装harbor
# cd /opt/software/harbor
# ./prepare
prepare base dir is set to /opt/software/harbor
Unable to find image 'goharbor/prepare:v2.10.3' locally
v2.10.3: Pulling from goharbor/prepare
# ./install.sh
[Step 0]: checking installation environment ...
Note: docker version: 26.1.3
Note: docker-compose version: 2.28.1
[Step 1]: loading Harbor images ...
2.7 查看生成的images和开发的端口
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
goharbor/harbor-exporter v2.10.3 7aa694114453 9 days ago 107MB
goharbor/redis-photon v2.10.3 359683ebd59c 9 days ago 165MB
goharbor/trivy-adapter-photon v2.10.3 6d51017555d9 9 days ago 516MB
goharbor/harbor-registryctl v2.10.3 96efb27ac641 9 days ago 152MB
goharbor/registry-photon v2.10.3 f73ad548d874 9 days ago 84.7MB
goharbor/nginx-photon v2.10.3 0ae16f53f286 9 days ago 154MB
goharbor/harbor-log v2.10.3 9ee81cca16ce 9 days ago 163MB
goharbor/harbor-jobservice v2.10.3 053df0842d37 9 days ago 143MB
goharbor/harbor-core v2.10.3 ed909856be82 9 days ago 171MB
goharbor/harbor-portal v2.10.3 c8c29cea2ef3 9 days ago 162MB
goharbor/harbor-db v2.10.3 c623b46fd89d 9 days ago 269MB
goharbor/prepare v2.10.3 292e199c8873 9 days ago 210MB
# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:1514 0.0.0.0:* LISTEN 1601/docker-proxy
tcp6 0 0 :::443 :::* LISTEN 1733/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 1745/docker-proxy
3. 访问登录harbor
https://{harbor主机ip},默认用户名/密码:admin/Harbor12345
标签:ago,Kubernetes,goharbor,--,days,Harbor,v2.10,harbor,docker From: https://www.cnblogs.com/cn-jasonho/p/18297769