Docker加速器替代方案

type
status
date
slug
summary
tags
category
icon
password
网址
😀
docker镜像拉取需要访问跨境资源,如果没有科学工具,以下方案可以平替
 

📝 主旨内容

前提:

1.创建一个阿里云账号(略)

2.开通云效产品,利用云效完成镜像拉取并push到个人版仓库

3.创建个人版镜像仓库并绑定代码源

🚶🏻‍♂️ 具体步骤:

一:完成云效配置

1.通过云效官网创建一个企业https://devops.console.aliyun.com/organizations/standard
notion image
2.进入企业点击代码管理
notion image
3.点击新建库并创建第一个文件为dockerfile 内容按dockerfile格式只填写FROM 段【镜像按需填写】
notion image

二:创建个人版镜像仓库

1.登录阿里云镜像仓库创建一个个人版实例[免费]
notion image
2.创建个人版实例后绑定codeup
notion image
  • 绑定时需要的绑定信息在云效首页个人设置里获取
notion image
  • 如图创建访问令牌,权限全选
notion image
notion image
3.开始创建镜像仓库并指定代码源
notion image
notion image
4.选定上述云效内创建的企业和库
notion image
5.在仓库内触发器页面创建一个构建规则并勾选海外加速
notion image
notion image
6.点击立即构建;就能将docker官方镜像tomcat:latest同步到国内acr仓库
notion image
7.如图,仓库内已有tomcat:latest版本镜像
notion image
8.使用个人仓库账号密码拉取测试:
notion image
  • 如果登录密码忘记了可以如图处重新设置
notion image

最终效果:

notion image

拓展:

  • 需求1.如果需要拉取tomcat的其他版本怎么处理:
答:
1.先到代码平台将dockerfile改为FROM tomcat:7
notion image
2.仓库的构建规则中版本改为7,点击立即构建即可
notion image
notion image
  • 需求2:如果需要拉取nginx或其他镜像如何处理
答:在个人版镜像仓库新建一个仓库名字为nginx----绑定上述代码源----到代码源更改FROM 引用为所需镜像如nginx等-----创建构建规则与上面步骤一致
 
💡
借助阿里个人版镜像仓库+云效实现全免费同步docker官方镜像到国内
Flutter 常用WidgetJenkins安装和使用案例(k8s)
Loading...
目录