Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器,可以用来构建企业内部的Docker镜像仓库。
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
yum install -y yum-utils
yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce-20.10.* docker-ce-cli-20.10.* containerd.io
docker-ce #社区版
#安装完成后验证
docker version
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://axvfsf7e.mirror.aliyuncs.com"]
}
EOF
#启动
systemctl daemon-reload
systemctl start docker
systemctl enable docker
#官网下载
https://docs.docker.com/compose/install
#安装
curl -L https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o usr/local/bin/docker-compose
#授权
chmod +x /usr/local/bin/docker-compose
#测试安装
docker-compose version
#卸载
rm -f /usr/local/bin/docker-compose
#创建harbor包存放目录
mkdir -p /opt/soft/harbor && cd /opt/soft/harbor
#下载地址
wget https://github.com/goharbor/harbor/releases/download/v1.10.10/harbor-online-installer-v1.10.10.tgz
#解压
tar -zxf harbor-online-installer-v1.10.10.tgz
#进入解压后的包
cd /opt/soft/harbor/harbor
vim harbor.yml
#配置文件harbor.yml详解
# 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: 机器ip地址或域名
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 80
# https related config
#下面的https需要注释掉
#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
./install.sh
#Harbor依赖的镜像及启动服务查看
docker-compose ps
#访问
http://ip:prot
评论