①系统镜像:CentOS7前端
②Docker:Docker version 19.03.5linux
③Docker-compose:docker-composenginx
参考官网安装便可:https://docs.docker.com/install/linux/docker-ce/centos/git
$ sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo docker run hello-world
参考官网安装:https://docs.docker.com/compose/install/github
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -version
以上安装较慢,如下方式也可行:docker
①cd /usr/local/bin/json
②wget https://github.com/docker/compose/releases/download/1.14.0-rc2/docker-compose-Linux-x86_64vim
③rename docker-compose-Linux-x86_64 docker-compose docker-compose-Linux-x86_64centos
④chmod +x /usr/local/bin/docker-compose浏览器
⑤docker-compose -version
官方GIthub地址:https://github.com/goharbor/harbor/releases(分为离线安装、在线安装,我这里采用离线安装)
tar -zxvf harbor-offline-installer-v1.2.0.tgz
mv harbor /usr/local/
openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
mkdir -p /data/cert mv server.* /data/cert/
chmod -R 777 /data/cert
核心组件:
①Proxy:nginx前端代理,代理Harbor的registry,UI,Token等服务
②jobservice:负责镜像复制
③ui:提供图形化界面
④db:负责存储用户权限、审计日志等数据
⑤adminserver:jobservice和ui启动时候须要加载其中的配置
⑥registry:镜像仓库(Docker官方)
⑦log:负责收集其余组件的log
注:此时是没法经过该命令推送的,缘由是这个仓库是属于zs用户,不作认证是没法推送镜像的。
vim/etc/docker/daemon.json
添加如下内容:
{"insecure-registries": ["serverip"] }
一样记得修改本地hosts文件映射(固然上一步能够直接配置IP)
配置本地hosts文件
拉取失败,这里须要身份认证
至此已经搭建完成Harbor私服,若有不正,欢迎指正!欢迎留言讨论问题,说不定你正在走的坑就是我走过的坑。哈哈~~~~