教程"/>
Docker Harbor 安装教程
1. Harbor简介
Harbor简介
Harbor is an open source container image registry that secures images with role-based access control, scans images for vulnerabilities, and signs images as trusted. A CNCF Incubating project, Harbor delivers compliance, performance, and interoperability to help you consistently and securely manage images across cloud native compute platforms like Kubernetes and Docker.
Harbor是一个开源容器镜像注册表,它通过基于角色的访问控制保护镜像,扫描镜像漏洞,并将镜像标记为可信镜像。作为CNCF的孵化项目,Harbor提供了遵从、性能和互操作性去帮助你一致而又安全的管理镜像通过像Kubernetes 和Docker这样的云计算平台。
官网:/
下载地址:
2. 服务端安装
- Root用户安装
- 已安装Docker
- 已安装docker-compose
- 内网安装建议使用域名,默认端口80,本文以myrepo.example
- 外网安装如果能申请域名使用域名,不能的话就ip+端口号,比如10.10.10.235:8888
2.1 下载安装包
wget .9.0/harbor-online-installer-v1.9.0.tgz
1.2 解压
tar zxvf harbor-online-installer-v1.9.0.tgz
1.3 修改配置文件
- 修改harbor配置文件
vi harbor.yml
如下图:
- 修改hosts文件
vi /etc/hosts
如下图:
1.4 启动harbor
- 环境检查
./prepare
- 安装并启动
./install.sh
1.5 登录harbor
- 访问myrepo.example
- 新建项目:hyperledger,访问级别:公开
- 创建用户:
- 给项目添加成员:
2. 客户端使用
- root用户登录或者sudo用户
- 已安装Docker
- 已安装docker-compose
- docker默认支持https
2.1 支持http
2.1.1 查看docker.service位置
- root用户登录或者sudo用户
systemctl status docker
2.1.2 修改docker.service
vi /usr/lib/systemd/system/docker.service
在ExecStart这一行后面增加内容:
--insecure-registry=myrepo.example
2.1.3 修改daemon.json
vi /etc/docker/daemon.json
添加私有仓库地址:
如下图:
2.1.4 修改hosts
vi /etc/hosts
添加内容:
192.168.134.150 myrepo.example
如下图:
2.2 重启docker
systemctl daemon-reload
systemctl restart docker
2.3 镜像上传下拉
- 应用用户
- 按指定格式打tag
docker tag hyperledger/fabric-ca:latest myrepo.example/hyperledger/fabric-ca-test:1.4.1
- 登录harbor
docker login myrepo.example
- Push镜像
docker push myrepo.example/hyperledger/fabric-ca-test:1.4.1
- Pull镜像
公共仓库的镜像无需登录即可直接pull
docker pull hyperledger/fabric-ca-test:1.4.1
更多推荐
Docker Harbor 安装教程
发布评论