分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

搭建docker私有仓库(用户认证、web管理)

发布时间:2023-09-06 02:16责任编辑:苏小强关键词:暂无标签

ubuntu:16.04

docker:18.06.0-ce

docker仓库服务器:192.168.83.102

--------------------------------------分割线--------------------------------------

1、生成私钥和证书  mkdir conf

openssl req -new -newkey rsa:4096 -days 365 -subj "/CN=localhost" ????????-nodes -x509 -keyout conf/auth.key -out conf/auth.cert

2、创建注册表配置 vim conf/registry-srv.ym

version: 0.1 ???storage: ?filesystem: ???rootdirectory: /var/lib/registry ???http: ?addr: 0.0.0.0:5000 ??????auth: ?token: ???# external url to docker-web authentication endpoint ???realm: http://192.168.83.102:8080/api/auth ???# should be same as registry.name of registry-web ???service: 192.168.83.102:5000 ???# should be same as registry.auth.issuer of registry-web ???issuer: ‘my issuer‘ ???# path to auth certificate ???rootcertbundle: /etc/docker/registry/auth.cert

3、启动容器服务registry-srv

docker run ????-v /data/registry:/var/lib/registry ????-v $(pwd)/conf/registry-srv.yml:/etc/docker/registry/config.yml:ro ????-v $(pwd)/conf/auth.cert:/etc/docker/registry/auth.cert:ro ????-p 5000:5000 ?--name=registry-srv --restart=always -d registry:2

4、创建配置文件vim conf/registry-web.yml

registry: ?# Docker registry url ?url: http://192.168.83.102:5000/v2 ?# Docker registry fqdn ?name: 192.168.83.102:5000 ?# To allow image delete, should be false ?readonly: false ?auth: ???# Enable authentication ???enabled: true ???# Token issuer ???# should equals to auth.token.issuer of docker registry ???issuer: ‘my issuer‘ ???# Private key for token signing ???# certificate used on auth.token.rootcertbundle should signed by this key ???key: /conf/auth.key

5、启动容器服务registry-web

docker run -v $(pwd)/conf/registry-web.yml:/conf/config.yml:ro ???????????-v $(pwd)/conf/auth.key:/conf/auth.key -v $(pwd)/db:/data ???????????-d -p 8080:8080 --restart=always --link registry-srv --name=registry-web hyper/docker-registry-web

6、通过web访问服务器地址http://192.168.83.102:8080

  默认用户密码是admin/admin

搭建docker私有仓库(用户认证、web管理)

原文地址:https://www.cnblogs.com/zcm1993/p/9732648.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved