harbor仓库部署

harbor仓库部署

提前布置好docker

Docker Compose官方文档

Harbor官方文档

[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里面修改)
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值