使用 docker-compose 搭建 Harbor 镜像仓库

介绍使用 docker-compose 搭建 Harbor 镜像仓库

前提条件

1.安装 docker
2.安装 docker-compose

下载 harbor

wget https://storage.googleapis.com/harbor-releases/release-1.5.0/harbor-offline-installer-v1.5.0.tgz 

tar xvf harbor-offline-installer-v1.5.0.tgz 

修改配置(hostname)

vim harbor.cfg 


# Configuration file of Harbor 
#This attribute is for migrator to detect the version of the .cfg file, DO NOT MODIFY! 
_version = 1.5.0 
#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 = YOUR_IP

启动和停止

cd harbor
docker-compose start 
docker-compose stop 

UI访问

地址:http://YOUR_IP/harbor/sign-in
账号密码:admin/Harbor12345

配置

访问镜像仓库
vim /etc/docker/daemon.json 


{ 
  "registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com"], 
  "exec-opts": ["native.cgroupdriver=systemd"], 
  "insecure-registries":["http://10.1.4.15"] 
} 
登录镜像仓库
[root@localhost harbor]# docker login YOUR_IP
Authenticating with existing credentials... 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json. 
Configure a credential helper to remove this warning. See 
https://docs.docker.com/engine/reference/commandline/login/#credentials-store 
Login Succeeded 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值