Docker搭建私有仓库harbor(docker 镜像仓库搭建)

  • Harbor介绍

Docker容器应用的开发和运行离不开可靠的镜像管理,虽然Docker官方也提供了公共的镜像仓库,但是从安全和效率等方面考虑,部署我们私有环境内的Registry也是非常必要的。Harbor是由VMware公司开源的企业级的Docker
Registry管理项目,它包括权限管理(RBAC)、LDAP、日志审核、管理界面、自我注册、镜像复制和中文支持等功能。
官网地址:https://github.com/goharbor/harbor

Docker Harbor是一个企业级的Docker Registry服务,旨在提供安全、可靠的镜像存储和管理解决方案。以下是Docker
Harbor的一些关键特点:

  1. 私有Registry:Docker Harbor允许用户搭建私有的Docker Registry,使得企业可以在自己的内部网络中安全地存储和管理Docker镜像。
  2. 安全性:Docker Harbor提供了访问控制、用户和团队管理功能,以确保镜像的安全性。它支持用户身份验证、权限控制、安全扫描等功能,帮助用户保护他们的容器镜像不受未经授权的访问。
  3. 可扩展性:Docker Harbor支持集群部署,可以轻松地扩展以应对大规模的容器镜像存储需求。
  4. 镜像复制和同步:Docker Harbor允许用户在不同的Registry之间复制和同步镜像,方便用户在多个部署环境之间共享和管理镜像。
  5. 审计和日志记录:Docker Harbor提供审计和日志记录功能,记录用户对镜像的操作,以帮助用户跟踪镜像的变更历史。 总的来说,Docker Harbor是一个功能强大的企业级Docker
    Registry服务,为用户提供了安全、可靠的方式来管理和存储Docker镜像。
  • 所需要的安装包

链接:https://pan.baidu.com/s/1rN25l72i6W36ANAOqxcc_w 提取码:1021

  1. 为harbor签发证书
[root@harbor ~]# hostnamectl set-hostname harbor && /bin/bash
[root@harbor ~]# mkdir /data/ssl -p
[root@harbor ~]# cd /data/ssl/

#生成ca证书
#生成一个3072位的key,也就是私钥
[root@harbor ssl]# openssl genrsa -out ca.key 3072
Generating RSA private key, 3072 bit long modulus
...........++
.............++
e is 65537 (0x10001)
#生成一个数字证书ca.pem,3650表示证书的有效时间是3年,按箭头提示填写即可,没有箭头标注的为空:
[root@harbor ssl]# openssl req -new -x509 -days 3650 -key ca.key -out ca.pem
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CH
State or Province Name (full name) []:BJ
Locality Name (eg, city) [Default City]:BJ
Organization Name (eg, company) [Default Company Ltd]:BJ
Organizational Unit Name (eg, section) []:BJ
Common Name (eg, your name or your server's hostname) []:CHONG
Email Address []:[email protected]

#生成域名的证书
#生成一个3072位的key,也就是私钥
[root@harbor ssl]# openssl genrsa -out harbor.key  3072
Generating RSA private key, 3072 bit long modulus
.++
..........................................................++
e is 65537 (0x10001)
#生成一个证书请求,一会签发证书时需要的,标箭头的按提示填写,没有箭头标注的为空:
[root@harbor ssl]# openssl req -new -key harbor.key -out harbor.csr
You are about to be asked to enter 

你可能感兴趣的:(docker,docker,容器,运维)