harbor仓库部署
提前布置好docker
[root@harbor ~]# DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
//创建一个隐藏的目录.docker
[root@harbor ~]# mkdir -p $DOCKER_CONFIG/cli-plugins
[root@harbor ~]# ls -a
.bashrc .ICEauthority .tcshrc
initial-setup-ks.cfg .viminfo
.config .local .wget-hsts
anaconda-ks.cfg .cshrc .mysql_history .bash_history .dbus mysql_install.sh .bash_logout .docker .pki
[root@harbor ~]# cd .docker/cli-plugins/
[root@harbor cli-plugins]#curl -SL https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
[root@harbor cli-plugins]# ls
docker-compose
//给这个文件一个执行权限
[root@harbor cli-plugins]# chmod +x docker-compose
//为了每次开机时都可以自己启动给它做一个软连接让系统可以找到它
[root@harbor cli-plugins]# ln -s /root/.docker/cli-plugins/docker-compose /usr/bin/
[root@harbor cli-plugins]# which docker-compose
/usr/bin/docker-compose
[root@harbor ~]# docker compose version
Docker Compose version v2.7.0
然后提前下载好官方包
[root@harbor harbor]# wget https://github.com/goharbor/harbor/releases/download/v2.5.3/harbor-offline-installer-v2.5.3.tgz
[root@harbor ~]# tar xf harbor-offline-installer-v2.5.3.tgz -C /usr/local/
[root@harbor ~]# cd /usr/local/
[root@harbor local]# ls
bin etc games harbor include lib lib64 libexec mysql sbin share src
[root@harbor local]# cd harbor/
[root@harbor harbor]# cp harbor.yml.tmpl harbor.yml
[root@harbor harbor]# vim harbor.yml
hostname: harbor.example.com //将这里改为你的主机名
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 80
//将https包括的所有都注释掉
# https related config
#https:
# https port for harbor, default is 443
# port: 443
# The path of cert and key files for nginx
# certificate: /your/certificate/path
# private_key: /your/private/key/path
然后执行install.sh这个脚本
[root@harbor harbor]# ls
common.sh harbor.yml install.sh prepare
harbor.v2.5.3.tar.gz harbor.yml.tmpl LICENSE
[root@harbor harbor]# ./install.sh
[Step 0]: checking if docker is installed ...
Note: docker version: 20.10.17
....
⠿ Container harbor-jobservice Started 7.7s
✔ ----Harbor has been installed and started successfully.----
[root@harbor harbor]# ss -anlt | grep 1514
LISTEN 0 128 127.0.0.1:1514 0.0.0.0:*
[root@harbor harbor]# ss -anlt | grep 80
LISTEN 0 128 0.0.0.0:80 0.0.0.0:*
LISTEN 0 128 [::]:80 [::]:*
LISTEN 0 64 [::]:38057 [::]:*
测试网页
账户为admin
默认密码为Harbor12345(可以在harbor.yml里面修改)