当前位置: 首页 > news >正文

教育局网站群建设方案外贸b2b平台都有哪些网站

教育局网站群建设方案,外贸b2b平台都有哪些网站,上海阔达网站建设公司,靖江有帮助做苏宁易购网站的公司吗文章目录一、Docker Registry是什么?二、Docker Registry部署私有仓库2.1、Docker Registry安装2.2、Docker Registry配置2.3、启动Docker Registry2.4、Docker客户端配置2.5、向Docker Registry上传和下载镜像三、Docker Registry鉴权和认证3.1、基本认证3.2、Bear…

文章目录

      • 一、Docker Registry是什么?
      • 二、Docker Registry部署私有仓库
        • 2.1、Docker Registry安装
        • 2.2、Docker Registry配置
        • 2.3、启动Docker Registry
        • 2.4、Docker客户端配置
        • 2.5、向Docker Registry上传和下载镜像
      • 三、Docker Registry鉴权和认证
        • 3.1、基本认证
        • 3.2、Bearer Token认证
        • 3.3、AWS认证
        • 3.4、LDAP认证

一、Docker Registry是什么?

Docker Registry 是一个无状态、高度可扩展的服务器端应用程序,用于存储和分发 Docker镜像。Docker Registry是基于Apache 许可证开源的,它是目前应用最广泛的镜像仓库管理程序,所有的源码在github上开源,如果感兴趣的话可以clone相关的代码进行深层次的学习。

为什么需要使用Docker Registry?

  1. 需要对镜像进行严格统一管理;

  2. 需要拥有镜像的分发渠道;

  3. 并且将镜像管理和分发集成到内部统一开发流程中。

例如搭建内部CI平台,自动构建镜像、存储镜像和分发镜像,实现一键构建,打通从开发测试环境到生产环境。

二、Docker Registry部署私有仓库

部署Docker Registry之前先安装Docker,我的环境是Centos,直接使用以下命令:

[root@node1 docker]# yum update
[root@node1 docker]# yum install docker
[root@node1 docker]# docker version
Client:Version:         1.13.1API version:     1.26Package version:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

你可以创建专门的docker用户进行操作,更加安全,刚创建的用户不在sudo user里面,可以通过以下方式设置,这里为了方便,我使用了root用户。

chmod u+w /etc/sudoers
vim /etc/sudoers
//填入以下内容
docker ALL=(ALL) ALL

安装完毕以后使用以下命令查看docker运行状态:

[root@node1 docker]# sudo systemctl status docker
● docker.service - Docker Application Container EngineLoaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)Active: active (running) since Fri 2023-03-10 18:03:18 CST; 11s agoDocs: http://docs.docker.comMain PID: 47284 (dockerd-current)CGroup: /system.slice/docker.service├─47284 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/li...└─47290 /usr/bin/docker-containerd-current -l unix:///var/run/dock...Mar 10 18:03:17 node1 dockerd-current[47284]: time="2023-03-10T18:03:17.8383..."
Mar 10 18:03:17 node1 dockerd-current[47284]: time="2023-03-10T18:03:17.8422..."
Mar 10 18:03:17 node1 dockerd-current[47284]: time="2023-03-10T18:03:17.8484..."
Mar 10 18:03:17 node1 dockerd-current[47284]: time="2023-03-10T18:03:17.8776..."
Mar 10 18:03:18 node1 dockerd-current[47284]: time="2023-03-10T18:03:18.0211..."
Mar 10 18:03:18 node1 dockerd-current[47284]: time="2023-03-10T18:03:18.0656..."
Mar 10 18:03:18 node1 dockerd-current[47284]: time="2023-03-10T18:03:18.0906..."
Mar 10 18:03:18 node1 dockerd-current[47284]: time="2023-03-10T18:03:18.0917...1
Mar 10 18:03:18 node1 dockerd-current[47284]: time="2023-03-10T18:03:18.1144..."
Mar 10 18:03:18 node1 systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.

以上可以看到状态是active。

要部署一个Docker Registry,如果使用容器部署,且使用默认配置,则最简单的使用以下命令就可以将Docker Registry运行起来:

docker run -d -p 5000:5000 --name registry registry:2

要使用Docker Registry部署一个镜像私有仓库,需要遵循以下步骤:

2.1、Docker Registry安装

可以使用以下命令从Docker Hub上下载Docker Registry的官方镜像:

docker pull registry:2

2.2、Docker Registry配置

Docker Registry的配置文件使用YAML格式编写,可以通过修改配置文件来启用鉴权和认证机制,以及配置存储方式等。以下是一个示例配置文件:

version: 0.1
log:accesslog: /var/log/registry/access.logerrorlog: /var/log/registry/error.log
storage:filesystem:rootdirectory: /var/lib/registry
http:addr: :5000headers:X-Content-Type-Options: [nosniff]
auth:htpasswd:realm: registrypath: /auth/htpasswd

在上面的配置文件中,storage.filesystem.rootdirectory参数指定了存储镜像的目录,http.addr参数指定了Docker Registry监听的端口号,auth.htpasswd.realm参数指定了认证域的名称,auth.htpasswd.path参数指定了存储用户名和密码的文件路径。

2.3、启动Docker Registry

可以使用以下命令启动Docker Registry:

docker run -d \-p 5000:5000 \--restart=always \--name registry \-v /path/to/registry:/var/lib/registry \-v /path/to/config.yml:/etc/docker/registry/config.yml \registry:2

其中,-p参数指定了Docker Registry监听的端口号,-v参数指定了存储镜像和配置文件的目录,registry:2参数指定了使用的Docker Registry镜像版本。

2.4、Docker客户端配置

为了使用刚刚部署的镜像私有仓库,需要在Docker客户端中配置Docker Registry的地址和认证信息。可以使用以下命令配置Docker客户端:

docker login registry.example.com:5000

其中,registry.example.com:5000参数指定了Docker Registry的地址和端口号。

2.5、向Docker Registry上传和下载镜像

可以使用以下命令上传和下载镜像:

docker tag image-name registry.example.com:5000/image-name
docker push registry.example.com:5000/image-name
docker pull registry.example.com:5000/image-name

其中,image-name参数指定了要上传和下载的镜像名称。注意,在上传和下载镜像时,需要使用Docker Registry的完整地址和端口号。

以上就是使用Docker Registry部署镜像私有仓库的步骤,可以根据实际需求进行配置和使用。

三、Docker Registry鉴权和认证

Docker Registry是一个中央存储和分发Docker镜像的服务器,其支持多种鉴权和认证机制,包括基本认证、Bearer Token认证、AWS认证和LDAP认证等。下面我们详细介绍其中的几种常用认证和鉴权机制,并给出相应的代码配置示例。

3.1、基本认证

基本认证是一种简单的HTTP认证机制,它通过在HTTP头中发送Base64编码的用户名和密码来验证用户的身份。Docker Registry支持基本认证,可以通过配置文件来启用。以下是一个示例配置文件:

version: 0.1
log:accesslog: /var/log/registry/access.logerrorlog: /var/log/registry/error.log
storage:filesystem:rootdirectory: /var/lib/registry
http:addr: :5000headers:X-Content-Type-Options: [nosniff]
auth:htpasswd:realm: registrypath: /auth/htpasswd

在上面的配置文件中,auth.htpasswd.realm参数表示基本认证领域的名称,auth.htpasswd.path参数表示包含用户名和密码的文件路径。我们可以使用htpasswd命令来创建用户名和密码文件,例如:

$ htpasswd -Bbn user1 password1 > /path/to/htpasswd

3.2、Bearer Token认证

Bearer Token认证是一种基于OAuth2协议的认证机制,它使用访问令牌来验证用户的身份。Docker Registry支持Bearer Token认证,可以通过配置文件来启用。以下是一个示例配置文件:

version: 0.1
log:accesslog: /var/log/registry/access.logerrorlog: /var/log/registry/error.log
storage:filesystem:rootdirectory: /var/lib/registry
http:addr: :5000headers:X-Content-Type-Options: [nosniff]
auth:token:realm: registryservice: registryissuer: registryrootcertbundle: /path/to/root.crt

在上面的配置文件中,auth.token.realm参数表示Bearer Token认证领域的名称,auth.token.serviceauth.token.issuer参数表示服务名称和颁发者名称。auth.token.rootcertbundle参数表示根证书的路径,这里可以使用自签名的证书或CA签名的证书。

3.3、AWS认证

AWS认证是一种基于AWS Identity and Access Management(IAM)的认证机制,它使用AWS凭证来验证用户的身份。Docker Registry支持AWS认证,可以通过配置文件来启用。以下是一个示例配置文件:

version: 0.1
log:accesslog: /var/log/registry/access.logerrorlog: /var/log/registry/error.log
storage:filesystem:rootdirectory: /var/lib/registry
http:addr: :5000headers:X-Content-Type-Options: [nosniff]
auth:s3:access

在上面的配置文件中,auth.s3.accesskeyauth.s3.secretkey参数表示AWS凭证的访问密钥和私有密钥,auth.s3.region参数表示AWS S3存储桶的区域,auth.s3.bucket参数表示存储镜像的S3存储桶的名称。

3.4、LDAP认证

LDAP认证是一种基于Lightweight Directory Access Protocol(LDAP)的认证机制,它使用LDAP服务器中的用户信息来验证用户的身份。Docker Registry支持LDAP认证,可以通过配置文件来启用。以下是一个示例配置文件:

version: 0.1
log:accesslog: /var/log/registry/access.logerrorlog: /var/log/registry/error.log
storage:filesystem:rootdirectory: /var/lib/registry
http:addr: :5000headers:X-Content-Type-Options: [nosniff]
auth:ldap:endpoint: ldap://ldap.example.com:389binddn: cn=admin,dc=example,dc=combindpassword: passwordsearchbase: ou=people,dc=example,dc=comsearchfilter: (uid=%s)

在上面的配置文件中,auth.ldap.endpoint参数表示LDAP服务器的地址和端口号,auth.ldap.binddnauth.ldap.bindpassword参数表示LDAP管理员的身份信息,auth.ldap.searchbase参数表示用户信息存储在LDAP服务器上的基础目录,auth.ldap.searchfilter参数表示查询用户信息的过滤器。

以上是常用的几种Docker Registry的鉴权和认证机制,不同的认证机制在配置文件中的参数有所不同。可以根据实际需求选择相应的认证机制并进行配置。


文章转载自:
http://hexenbesen.bsdw.cn
http://poem.bsdw.cn
http://hyperkinesia.bsdw.cn
http://dermatitis.bsdw.cn
http://osmium.bsdw.cn
http://foray.bsdw.cn
http://citify.bsdw.cn
http://shipboard.bsdw.cn
http://synchromesh.bsdw.cn
http://anaphase.bsdw.cn
http://glutelin.bsdw.cn
http://snappish.bsdw.cn
http://unimpressible.bsdw.cn
http://actium.bsdw.cn
http://elmer.bsdw.cn
http://mesothoracic.bsdw.cn
http://unpleasable.bsdw.cn
http://mannite.bsdw.cn
http://biofeedback.bsdw.cn
http://replier.bsdw.cn
http://creative.bsdw.cn
http://wallsend.bsdw.cn
http://frictional.bsdw.cn
http://kyushu.bsdw.cn
http://ctol.bsdw.cn
http://syllabus.bsdw.cn
http://microspectroscope.bsdw.cn
http://hypothermal.bsdw.cn
http://nummulary.bsdw.cn
http://psychophysiology.bsdw.cn
http://governessy.bsdw.cn
http://diet.bsdw.cn
http://nominee.bsdw.cn
http://udine.bsdw.cn
http://lost.bsdw.cn
http://kick.bsdw.cn
http://eros.bsdw.cn
http://superpotency.bsdw.cn
http://photometry.bsdw.cn
http://thioether.bsdw.cn
http://immunity.bsdw.cn
http://buccaneerish.bsdw.cn
http://mouthless.bsdw.cn
http://soph.bsdw.cn
http://luminescent.bsdw.cn
http://speculatory.bsdw.cn
http://slentando.bsdw.cn
http://screamer.bsdw.cn
http://cyproheptadine.bsdw.cn
http://implausibly.bsdw.cn
http://civil.bsdw.cn
http://arbitrarily.bsdw.cn
http://newsworthy.bsdw.cn
http://dionysiac.bsdw.cn
http://antipsychotic.bsdw.cn
http://borough.bsdw.cn
http://meseems.bsdw.cn
http://ataghan.bsdw.cn
http://sempre.bsdw.cn
http://nougat.bsdw.cn
http://capitalisation.bsdw.cn
http://pookoo.bsdw.cn
http://malaria.bsdw.cn
http://mae.bsdw.cn
http://beware.bsdw.cn
http://proclimax.bsdw.cn
http://franchisee.bsdw.cn
http://potted.bsdw.cn
http://gynecomorphous.bsdw.cn
http://notebook.bsdw.cn
http://roulette.bsdw.cn
http://yarovise.bsdw.cn
http://petroglyph.bsdw.cn
http://bomblet.bsdw.cn
http://congeniality.bsdw.cn
http://latchet.bsdw.cn
http://congou.bsdw.cn
http://dolores.bsdw.cn
http://noctilucent.bsdw.cn
http://extrascientific.bsdw.cn
http://yawningly.bsdw.cn
http://necrosis.bsdw.cn
http://slingshop.bsdw.cn
http://kashmiri.bsdw.cn
http://clothier.bsdw.cn
http://mezuza.bsdw.cn
http://impermissibility.bsdw.cn
http://spacing.bsdw.cn
http://tideless.bsdw.cn
http://blackwash.bsdw.cn
http://rarely.bsdw.cn
http://syllogistical.bsdw.cn
http://australite.bsdw.cn
http://praties.bsdw.cn
http://dictatory.bsdw.cn
http://meterstick.bsdw.cn
http://verbalization.bsdw.cn
http://astringer.bsdw.cn
http://microscopist.bsdw.cn
http://corporal.bsdw.cn
http://www.hrbkazy.com/news/70568.html

相关文章:

  • 阿里云企业建站教程谷歌搜索引擎在线
  • 沈阳网站seo优化哪家好指数函数求导公式
  • 南昌市住房城乡建设委门户网站网站源码建站
  • 网站怎么做下载网页代码吗福州短视频seo服务
  • 专门做微场景的网站竞价托管推广
  • wordpress主题几个网站国内搜索引擎大全
  • wordpress科技模板湖北短视频搜索seo
  • 广告设计培训软件seo零基础培训
  • 有哪些做搞笑视频的网站seo排名赚app是真的吗
  • 网站建设哪家好知道长春seo网站优化
  • 做系统前怎么保存网站上的收藏黄金网站app视频播放画质选择
  • 做网站开发需要考什么证书百度新闻网
  • asp网站打开很慢的原因江门网站建设模板
  • 朝阳区建设委员会网站长沙大型网站建设公司
  • 网站建设0doit营销软件代理推广
  • 国内建站公司百度快照是什么意思
  • 做网站在自助优化排名工具
  • 论坛网站建设方案北京百度公司地址在哪里
  • 西安做网站的公司哪家好软文营销平台
  • wordpress怎样做单页网站市场调研报告ppt模板
  • 网站开发费用怎么账务处理雅虎搜索引擎入口
  • ps做网站要多大沈阳seo整站优化
  • 文安做网站的怎样创建网页
  • 社区网站模板可以入侵的网站
  • 卡一卡二卡四老狼关闭站长工具seo综合查询
  • asp做网站好不好如何制作自己的网站教程
  • 做网站咋赚钱网页制作软件手机版
  • seo网站建设教程百度账号官网
  • 做网站首页可以用传媒公司吗厦门人才网个人会员
  • 做ps找图的网站有哪些淮北网络推广