【Linus搭建Harbor环境】
目录
一、安装前准备
1.1安装Docker
- docker -v
1.2安装docker-compose
- sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- docker-compose --version
二、安装
2.1 下载安装包
2.2 解压安装包
- tar -zxvf harbor-offline-installer-v1.2.2.tgz
2.3 修改配置文件
cd harbor && vi harbor.cfg
hostname = A.B.C.D #harbor服务器地址
2.4 修改Docker配置
- vi /etc/docker/daemon.json #docker login默认是https访问, 配置连接harbor地址 http可访问(没有则创建该文件)
{
"insecure-registries": [
"192.168.137.132"
]
}
- systemctl restart docker #重启docker
2.5 安装Harbor
- cd harbor && ./install.sh
2.6 登录Harbor
- 登录地址:http://A.B.C.D 用户名:admin 密码:Harbor12345
- 新建私有项目my-harbor-test
2.7 推送本地镜像到Harbor仓库
- docker tag elasticsearch:6.4.0 A.B.C.D/my-harbor-test(创建的项目名称)/elasticsearch:6.4.0
- docker login A.B.C.D -u admin -p Harbor12345
- docker push A.B.C.D/my-harbor-test/elasticsearch:6.4.0