Docker学习四--Harbor私有仓库搭建

安装docker-compose

首先需要先安装docker-compose才能进行安装Harbor。

进入官网

根据官网的提示安装docker-compose:
在这里插入图片描述

  1. 在linux系统下下载;
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

由于是国外的网站可能下载较慢,可以多试几次;当然你也可以使用国内的源地址进行下载

curl -L https://get.daocloud.io/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m`  > /usr/local/bin/docker-compose
  1. 将可执行权限应用于二进制文件;
sudo chmod +x /usr/local/bin/docker-compose
  1. 验证是否安装成功
docker-compose -version

这样docker-compose就安装完成了,此时准备工作完成。

安装Harbor

下载harbor的离线安装包

此处我是用的是 harbor-offline-installer-v1.9.4.tgz,可以通过我上传的资源进行下载地址harbor离线宝

进入系统进行安装

将下载的离线包传到linux系统上

## 1、解压缩
[root@master ~]# tar -zxvf harbor-offline-installer-v1.9.4.tgz 
harbor/harbor.v1.9.4.tar.gz
harbor/prepare
harbor/LICENSE
harbor/install.sh
harbor/harbor.yml
[root@master ~]# ls
anaconda-ks.cfg  conf  data  harbor  harbor-offline-installer-v1.9.4.tgz  logs  nginx-1.19.6  nginx-1.19.6.tar.gz  store
## 2、进入解压后的路径
[root@master ~]# cd harbor
[root@master harbor]# ls
harbor.v1.9.4.tar.gz  harbor.yml  install.sh  LICENSE  prepare
## 3、执行准备安装文件
[root@master harbor]# ./prepare
prepare base dir is set to /root/harbor
Unable to find image 'goharbor/prepare:v1.9.4' locally
v1.9.4: Pulling from goharbor/prepare
59bb73b1db41: Pull complete 
151a8120c357: Pull complete 
bdb3b55ae888: Pull complete 
bc627acc6004: Pull complete 
b9e028a223e6: Pull complete 
0b1166b529f5: Pull complete 
5255c5c54d23: Pull complete 
Digest: sha256:3b0e3b40be3056aa2eab2f02393065a615e442c7e6f572def2f1f991257c8d5d
Status: Downloaded newer image for goharbor/prepare:v1.9.4
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
Generated and saved secret to file: /secret/keys/secretkey
Generated certificate, key file: /secret/core/private_key.pem, cert file: /secret/registry/root.crt
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir

## 4、执行安装脚本
[root@master harbor]# ./install.sh 
➜ Please set hostname and other necessary attributes in harbor.yml first. DO NOT use localhost or 127.0.0.1 for hostname, because Harbor needs to be accessed by external clients.
Please set --with-notary if needs enable Notary in Harbor, and set ui_url_protocol/ssl_cert/ssl_cert_key in harbor.yml bacause notary must run under https. 
Please set --with-clair if needs enable Clair in Harbor
Please set --with-chartmuseum if needs enable Chartmuseum in Harbor

## 5、修改配置 此处比较重要
[root@master harbor]# vi harbor.yml 
## 修改hostname
# Configuration file of Harbor

# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: 192.168.135.110
...
...
...

## 6、执行安装脚本
[root@master harbor]# ./install.sh 

通过浏览器访问登录系统

http://192.168.135.110/harbor 这里注意修改为你自己的ip地址
用户名: admin
密码: Harbor12345
密码是在harbor.yml 中配置的。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值