docker 安装harbor

Docker怎么安装Harbor镜像仓库

什么是Docker?

Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器或Windows机器上,也可以实现虚拟化,容器是完全使用沙箱机制,相互之间不会有任何接口。

docker 安装harbor

什么是Harbor?

Harbor是一个企业级的Docker Registry管理工具,用于存储和管理Docker镜像,它提供了安全的用户认证、访问控制、镜像签名等功能,帮助开发者更好地管理和使用Docker镜像。

如何安装Harbor镜像仓库?

本文将介绍如何在Linux系统下安装Harbor镜像仓库,首先确保已经安装了Docker和Docker Compose,然后按照以下步骤进行安装:

1、下载Harbor安装包

wget https://github.com/goharbor/harbor/releases/download/v2.3.3/harbor-online-installer-v2.3.3.tgz

2、解压安装包

docker 安装harbor

tar xvf harbor-online-installer-v2.3.3.tgz

3、进入解压后的目录

cd harbor

4、修改配置文件

打开harbor.yml文件,根据实际需求修改相关配置,例如数据库连接信息、端口号等,以下是一个简单的示例配置:

hostname: myharbor.example.com  域名或者IP地址
http:
  port: 80  端口号,默认为8080
  https:
    port: 443  端口号,默认为8443(HTTPS)或4443(HTTP)
  internal_host: 192.168.1.100  Docker主机IP地址,用于内外网访问时使用
external_url: http://myharbor.example.com  外部访问地址,用于域名解析时使用
data_volume: /mnt/data  数据卷挂载路径,用于持久化存储数据
expose_port: 80  暴露的端口号,默认为8080(HTTP)或4443(HTTPS)

5、创建管理员账号

docker 安装harbor

./install.sh --with-notary --with-trivy --with-chartmuseum --with-redis --with-postgresql --admin-password=your_password --email=admin@example.com --hostname=myharbor.example.com --ip=192.168.1.100 --port=8080 --with-clair --with-dockerhub-registry --with-plugin-dir=/path/to/plugins --with-storage-driver=csi-driver --csi-driver-volume-name=mydatavolume --csi-driver-publish-mode=readwritemany --csi-controller-count=1 --csi-controller-publish-secret=your_csi_controller_publish_secret --with-registry-auth --with-kubernetes --with-clair-dashboard --with-trivy-dashboard --with-nfs-server=your_nfs_server_ip --with-nfs-path=/path/to/nfs --with-extracaching --with-registrydb=postgres --registrydb-user=postgres --registrydb-password=your_registrydb_password --registrydb-port=5432 --registrydb-sslmode=disable --registrydb-sslcert=/path/to/sslcert --registrydb-sslkey=/path/to/sslkey --registrydb-sslrootcert=/path/to/sslrootcert

6、启动Harbor服务

sudo systemctl start docker@harbor.service  如果使用Docker Compose部署,请执行此命令;否则,请注释掉此行并直接执行第7步。

7、验证Harbor是否成功安装并运行

在浏览器中访问http://myharbor.example.com,如果看到Harbor的登录页面,说明安装成功,接下来需要添加镜像仓库、用户和权限等操作,具体操作请参考官方文档:https://goharbor.io/docs/2.3.3/installation_guidebook/zh_CN/index.html

原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/145772.html

(0)
K-seoK-seoSEO优化员
上一篇 2023年12月19日 09:57
下一篇 2023年12月19日 10:00

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

免备案 高防CDN 无视CC/DDOS攻击 限时秒杀,10元即可体验  (专业解决各类攻击)>>点击进入