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

阿勒泰高端网站建设公司计算机最吃香的职业

阿勒泰高端网站建设公司,计算机最吃香的职业,html怎么设置网站吗,wordpress搭建表格Docker安装部署Nexus3作为内网镜像代理 一、背景描述 基础镜像比较小,仓库使用阿里云或者腾讯云拉取速度挺快,但是时光飞逝几年时间过去,再加上AI加持的情况下,有些镜像的大小已经接近20G! 这种情况下不管是测试环境…

Docker安装部署Nexus3作为内网镜像代理

一、背景描述

基础镜像比较小,仓库使用阿里云或者腾讯云拉取速度挺快,但是时光飞逝几年时间过去,再加上AI加持的情况下,有些镜像的大小已经接近20G!
这种情况下不管是测试环境还是开发环境拉取镜像都会占用公司宽带流量,因此需要在测试环境搭建一台容器代理,用于缓存镜像!

二、搭建Nexus3作为镜像代理缓存阿里云、腾讯仓库私有镜像

2.1、Docker部署Nexus3

#数据持久化目录
mkdir -p /data/nexus3
#授权
chmod 777 -R /data/nexus3
#创建nexus3容器。
docker run -tid \--privileged=true\--network=host \--restart=always \-v /data/nexus3:/nexus-data \--name nexus3 \sonatype/nexus3#查看默认密码
cat /data/nexus3/admin.password 

2.2、登录nexus3并修改默认密码

修改默认密码,设置来宾用户访问
在这里插入图片描述
否则拉取镜像时会有如下报错:

[root@localhost certs.d]# crictl pull nginx
FATA[0002] pulling image failed: rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/nginx:latest": failed to unpack image on snapshotter overlayfs: unexpected media type text/html for sha256:b6a78ff088000afc609fcbc701d18704ddb944e867af0dadd520d4bf0e5af328: not found 

三、配置Nexus3代理阿里云、腾讯云私有镜像仓库

3.0 备注

这里会创建三个代理
1、阿里云镜像加速
2、阿里云私有镜像仓库(内含公开镜像)
3、腾讯云私有镜像仓库
私有镜像仓库需要配置认证账号密码

3.1、创建Blob Store

在这里插入图片描述

3.2、创建阿里云私有镜像仓库代理

在这里插入图片描述
设置代理信息
在这里插入图片描述
勾选缓存镜像layer,选择创建的Blob store
在这里插入图片描述
因为使用的阿里云北京区的镜像仓库,所以这里填入北京区地址,如果是腾讯云仓库替换即可。
填入阿里云私有仓库认证账号密码
在这里插入图片描述
信息填完后点击Create repositories 完成创建。

3.3、重复3.2步骤创建好腾讯私有镜像仓库代理!

3.4、创建Docker-Group

选择docker(group类型)
在这里插入图片描述
红框需要设置或勾选信息
通过8888端口对外提供代理服务
在这里插入图片描述

把刚创建的docker代理加入到群组中
在这里插入图片描述

四、配置Containerd通过Nexus3镜像仓库下载镜像

4.0、Containerd 版本:

[root@localhost src]# ctr version
Client:Version:  v1.6.21Revision: 3dce8eb055cbb6872793272b4f20ed16117344f8Go version: go1.19.9Server:Version:  v1.6.21Revision: 3dce8eb055cbb6872793272b4f20ed16117344f8UUID: 01b66c6f-637c-4a15-a5db-fb0f75f1fe60

4.1、containerd默认配置

[root@localhost src]# cat /etc/containerd/config.toml 
version = 2
root = "/var/lib/containerd"
state = "/run/containerd"
oom_score = 0[grpc]address = "/run/containerd/containerd.sock"uid = 0gid = 0max_recv_message_size = 16777216max_send_message_size = 16777216[debug]address = "/run/containerd/containerd-debug.sock"uid = 0gid = 0level = "warn"[timeouts]"io.containerd.timeout.shim.cleanup" = "5s""io.containerd.timeout.shim.load" = "5s""io.containerd.timeout.shim.shutdown" = "3s""io.containerd.timeout.task.state" = "2s"[plugins][plugins."io.containerd.grpc.v1.cri"]sandbox_image = "sealos.hub:5000/pause:3.2"max_container_log_line_size = -1max_concurrent_downloads = 20disable_apparmor = true[plugins."io.containerd.grpc.v1.cri".containerd]snapshotter = "overlayfs"default_runtime_name = "runc"[plugins."io.containerd.grpc.v1.cri".containerd.runtimes][plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]runtime_type = "io.containerd.runc.v2"runtime_engine = ""runtime_root = ""[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]SystemdCgroup = true[plugins."io.containerd.grpc.v1.cri".registry]config_path = "/etc/containerd/certs.d"[plugins."io.containerd.grpc.v1.cri".registry.configs][plugins."io.containerd.grpc.v1.cri".registry.configs."sealos.hub:5000".auth]username = "admin"password = "passw0rd"

4.3、添加nexus3代理镜像

在config_path = “/etc/containerd/certs.d” 路径下创建需要经过nexus3的仓库文件夹

/etc/containerd/certs.d
[root@localhost certs.d]# ls -l
总用量 0
drwxr-xr-x 2 root root 24 9月   9 00:30 ccr.ccs.tencentyun.com
drwxr-xr-x 2 root root 24 9月   8 23:50 docker.io
drwxr-xr-x 2 root root 24 9月   8 23:50 registry.cn-beijing.aliyuncs.com
drwxr-xr-x 2 root root 24 9月   8 23:14 sealos.hub:5000
drwxr-xr-x 2 root root 24 9月   8 23:50 tf72mndn.mirror.aliyuncs.com
[root@localhost certs.d]# 

配置信息:

[root@localhost certs.d]# cat registry.cn-beijing.aliyuncs.com/hosts.toml 
server = "https://registry.cn-beijing.aliyuncs.com"[host."http://172.27.100.251:8888"]capabilities = ["pull", "resolve", "push"]skip_verify = true

4.4、重启Containerd并拉取镜像验证

[root@localhost certs.d]# systemctl restart containerd
[root@localhost certs.d]# crictl pull nginx

在这里插入图片描述
如上图所示,镜像已缓存!

五、Docker通过Nexus代理下载镜像

5.1、配置Nexus–Security–Realms

在这里插入图片描述

5.2、修改docker daemon.json配置

[root@localhost ~]# cat /etc/docker/daemon.json
{"insecure-registries": ["172.27.100.251:8888"],"registry-mirrors": ["http://172.27.100.251:8888"],"exec-opts": ["native.cgroupdriver=systemd"],"log-opts": {"max-file": "3","max-size": "500m"}
}

docker info

 Insecure Registries:172.27.100.251:8888127.0.0.0/8Registry Mirrors:http://172.27.100.251:8888/Live Restore Enabled: false

拉取镜像测试

参考:https://blog.csdn.net/qq_30051761/article/details/131139204

http://www.yayakq.cn/news/448728/

相关文章:

  • oppo手机应用商店有实力的网站排名优化软件
  • 忠县网站制作微名片网站怎么做
  • 怎么做网站的排名优化wordpress连接信息
  • 贵州二级站seo整站优化排名网站排名突然掉没了
  • 简约大气网站重庆观音桥有什么好玩的
  • 百度网站加v网站建设找超速云
  • 嵊州市住房和建设局网站wordpress+响应速度
  • 网站建设公司包括哪些搜索引擎优化
  • 好的手机端网站模板下载网站推广方案中确定目标是指
  • 湖南网站建设 要上磐石网络游戏推广怎么做
  • 网站首页生成静态页面免费国外服务器地址
  • 网站建设基本要求公司想为一个产品做多个网站
  • 网站建设推荐信息网站开发培训北京
  • 六安网站建设推荐沈阳沈阳建设工程信息网站
  • html用户登录注册页面代码seo关键字优化
  • 电子商务网站建设的结论桂林网页
  • 述建设一个网站的具体步骤jsp网站开发四库全书
  • 什么网站比较容易做陕西省交通建设厅网站
  • 新增备案网站负责人建筑设计怎么学
  • 问卷调查网站赚钱wordpress同标题关键字
  • 浙江省水利建设行业协会网站91色做爰网站
  • 庆阳网站优化公司头条淘宝联盟网站推广怎么做
  • 网站怎么让谷歌收录营销软文案例
  • 绍兴市越城区建设局网站淘客推广网站怎么做的
  • 免费个人网站下载中国外贸网站
  • 初学者想学网站建设wordpress读取文章样式
  • 做那种的视频网站网站建设捌金手指花总六
  • 网站建设课程设计文献综述网店营销策划方案ppt
  • c 网站开发框架有淘宝客 wordpress 主题
  • 如何把做好的网站代码变成网页效果图网站排行榜前十名