14、harbor

14、harbor

2c4g、400g

harbor(centos-7.9)(4c8g-400g)

echo "PS1='\[\033[35m\][\[\033[00m\]\[\033[31m\]\u\[\033[33m\]\[\033[33m\]@\[\033[03m\]\[\033[35m\]\h\[\033[00m\] \[\033[5;32m\]\w\[\033[00m\]\[\033[35m\]]\[\033[00m\]\[\033[5;31m\]\\$\[\033[00m\] '" >> ~/.bashrc && source ~/.bashrc

hostnamectl set-hostname harbor && su -

docker-compose安装harbor-v2.10.0

1、安装 docker

腾讯源

wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo
sudo sed -i 's+download.docker.com+mirrors.cloud.tencent.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
yum -y install docker-ce

systemctl enable docker
systemctl start docker

2、安装 docker-compose

官方文档:https://docs.docker.com/compose/install/

github:https://github.com/docker/compose/releases/

wget -O /usr/local/sbin/docker-compose https://github.com/docker/compose/releases/download/v2.24.1/docker-compose-linux-x86_64

chmod +x /usr/local/sbin/docker-compose

3、安装 harbor

https://github.com/goharbor/harbor/releases (离线下载上传)

wget https://github.com/goharbor/harbor/releases/download/v2.10.0/harbor-offline-installer-v2.10.0.tgz
cd && tar xf harbor-offline-installer-v2.10.0.tgz -C /usr/local/
ls -la /usr/local/harbor/

cp /usr/local/harbor/harbor.yml.tmpl /usr/local/harbor/harbor.yml
修改配置文件:
#  harbor.yml
1、改成本机ip(域名)
hostname: harbor.huanghuanhui.cloud

2、修改https协议证书位置
https:
  port: 443
  certificate: /root/ssl/huanghuanhui.cloud.crt
  private_key: /root/ssl/huanghuanhui.cloud.key

3、修改登录密码(生产环境一定要修改)
harbor_admin_password: Admin@2024
sed -i.bak 's/reg\.mydomain\.com/harbor.huanghuanhui.cloud/g' /usr/local/harbor/harbor.yml

sed -i 's#certificate: .*#certificate: /root/ssl/huanghuanhui.cloud.crt#g' /usr/local/harbor/harbor.yml

sed -i 's#private_key: .*#private_key: /root/ssl/huanghuanhui.cloud.key#g' /usr/local/harbor/harbor.yml

sed -i 's/Harbor12345/Admin@2024/g' /usr/local/harbor/harbor.yml
# ./install.sh(执行安装脚本)
/usr/local/harbor/install.sh
docker ps |grep harbor

访问地址:harbor.huanghuanhui.cloud

账号密码:admin、Admin@2024

你可能感兴趣的:(kubernetes,容器,云原生,istio,网络)