CentOS搭建Harbor仓库

搭建Harbor仓库

  • 搭建Harbor
    • 安装docker
    • 安装docker-compose
    • 安装Harbor
    • 访问
  • Https访问Harbor

搭建Harbor

root用户运行

安装docker

yum install -y yum-utils
#安装docker源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum makecache fast
#安装docker
yum install -y docker-ce
#设置自启
systemctl enable docker
#启动docker
systemctl start docker




安装docker-compose

#下载
curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#设置权限
chmod +x /usr/local/bin/docker-compose
#查看版本
docker-compose --version




安装Harbor

下载解压

#下载地址
https://github.com/goharbor/harbor/releases
#解压
tar -zxvf harbor-offline-installer-v1.10.2.tgz

修改配置文件

cd harbor

vim harbor.yml

#服务器IP
hostname: 192.168.1.11
#admin密码
harbor_admin_password : admin

安装

./prepare
./install.sh




访问

http://192.168.1.11







Https访问Harbor

#关闭harbor
cd harbor
docker-compose stop
#证书存放目录,默认是/data/cert
#修改配置文件harbor.yml
vi harbor.yml

#设置域名
hostname: harbor.com


https:
  # https port for harbor, default is 443
  port: 443
  # The path of cert and key files for nginx
  certificate: /data/cert/harbor.com.pem
  private_key: /data/cert/harbor.com.key

#重置并启动
./prepare
./install.sh 或 docker-compose up –d

你可能感兴趣的:(docekr)