【harbor】Registry 配置基于token的认证
1. 前言
registry默认配置下是没有认证授权的,在没有认证的情况下用户可以在registry种为所欲为,需要认证授权则需要额外配置。
基于token认证的方式可以很好的将registry和认证中心解耦,并能具有很高的安全性。harbor也是基于token的认证方式
2. docker login
之前的文章写到过docker login的流程
具体流程如图
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-txA9njl6-1576057964203)(https://github.com/docker/distribution/raw/master/docs/spec/images/v2-registry-auth.png)]
3. 配置
启动基于token认证的registry创建配置文件config.yml
挂载到/etc/registry/config.yml
http:
addr: :5000
secret: placeholder
debug:
addr: localhost:5001
auth:
token:
issuer: harbor-token-issuer
realm: http://192.168.79.1/archer/auth
rootcertbundle: /etc/registry/root.crt