1.安装docker-compose
yum install docker-compose
或:
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
docker-compose --version
1.git下载Harbor
2.解压
3.修改默认配置文件
拷贝 harbor.yml.tmpl 为harbor.yml
并更改配置
将hostname改为本机IP,更改对外端口号(默认80),#号注销掉https的配置
hostname: 192.168.1.*
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 8001
#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
harbor_admin_password: 12345678
4.运行
./install.sh
5.上传镜像
5.1修改docker配置
vi /etc/docker/daemon.json
5.2重启daocker
systemctl restart docker
5.3登录仓库
docker login 192.168.1.*
5.4制作镜像
docker tag SOURCE_IMAGE[:TAG] 192.168.1.*:8001/demo/REPOSITORY[:TAG]
5.5推送镜像
docker push 192.168.1.*:8001/demo/REPOSITORY[:TAG]