安装环境需求
-
安装docker
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
-
安装docker compose
curl -Lhttps://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
安装Harbor
-
选择版本
https://github.com/goharbor/harbor/releases
-
下载最新版
wget https://github.com/goharbor/harbor/releases/download/v1.9.3/harbor-offline-installer-v1.9.3.tgz
-
安装最新版
tar -zxvf harbor-offline-installer-v1.9.3.tgz
-
配置harbor.cfd 参数
hostname = www.liliguang.top #目标的主机名 ui_url_protocol = https #默认为http harbor_admin_password = Harbor12345 #默认admin账号密码
-
配置https证书及相关权限
mkdir /data/cert cd /data/cert openssl genrsa -des3 -out server.key 2048 openssl req -new -key server.key -out server.csr cp server.key server.key.org opensslrsa -in server.key.org -out server.key openssl x509 -req -days 365 -in server.csr-signkey server.key -out server.crt chmod -R 777 /data/cert
-
运行脚本
./install.sh
-
指定镜像仓库地址
vim/etc/docker/daemon.json {"insecure-registries": ["www.liliguang.top"] }
-
访问测试
https://www.liliguang.top 账号:admin 密码:Harbor12345