Files
Schulung_Docker_k8s/harbor_install
nutzer26 bed22c6720 added
2022-12-13 17:55:43 +01:00

57 lines
1.6 KiB
Plaintext

wget https://github.com/goharbor/harbor/releases/download/v2.6.2/harbor-online-installer-v2.6.2.tgz
tar xzf harbor-online-installer-v2.6.2.tgz
cd harbor
mkdir -p data/cert
cd data/cert
openssl genrsa -out ca.key 4096
openssl req -x509 -new -nodes -sha512 -days 3650 \
-subj "/C=CN/ST=NRW/L=Germany/O=linuxhotel/OU=Dev/CN=harbor.local" \
-key ca.key \
-out ca.crt
openssl genrsa -out harbor.local.key 4096
openssl req -sha512 -new \
-subj "/C=CN/ST=NRW/L=Germany/O= linuxhotel/OU=Dev/CN=harbor.local" \
-key harbor.local.key \
-out harbor.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.local
DNS.2=harbor
EOF
openssl x509 -req -sha512 -days 3650 \
-extfile v3.ext \
-CA ca.crt -CAkey ca.key -CAcreateserial \
-in harbor.local.csr \
-out harbor.local.crt
openssl x509 -inform PEM -in harbor.local.crt -out harbor.local.cert
sudo /bin/bash
mkdir -p /etc/docker/certs.d/harbor.local/
cp harbor.local.cert /etc/docker/certs.d/harbor.local/
cp harbor.local.key /etc/docker/certs.d/harbor.local/
cp ca.crt /etc/docker/certs.d/harbor.local/
systemctl restart docker
exit
cd ~/harbor
cp harbor.yml.tmpl harbor.yml
# set Data to /home/nutzer46/harbor/data
# set certs key/crt
./prepare --with-trivy
sudo ./install.sh --with-trivy
https://goharbor.io/docs/2.6.0/install-config/download-installer/
https://goharbor.io/docs/2.6.0/install-config/configure-https/
https://github.com/goharbor/harbor/releases/tag/v2.6.2