1. alipay 镜像仓库 地址 (自行换成本身的阿里镜像云DockerHub地址)git
https://cr.console.aliyun.com/repository/docker
2.alipay 代码云 地址 (自行换成本身的阿里代码云GitHub地址)安全
https://code.aliyun.com/tiandong19860806bash
Step 1: 本地电脑git bash环境设置ssh
root >> git config --global user.name "tiandong19860806"阿里云
root >> git config --global user.email "tiandong19860806@126.com"3d
root >> ssh-keygen -t rsa -C "tiandong19860806@126.com"code
root >> git config --global credential.helper storeblog
Step 2: 建立源代码git仓库dns
root >> mkdir -p d:/k8s_work_git/
root >> git clone https://code.aliyun.com/tiandong19860806/mirror_k8s_coredns.git
root >> git checkout -b master
root >> touch CoreDNS.Dockerfile
root >> vi CoreDNS.Dockerfile
# 而后编辑和保存以下内容:来自kubenetes.1.14.1源代码包中的CoreDNS安装镜像。这里加上我的维护信息
FROM k8s.gcr.io/coredns:1.3.1
MAINTAINER tian.dong <tiandong19860806@126.com>
# 下面准备备注,而且提交代码到远程GIT仓库
root >> git add .
root >> git commit -m "CoreDNS-1.3.1 image dockerfile"
root >> git push origin master
Step 3: 建立镜像仓库
Step 4: 选择要构建的源代码的具体项目
Step 5: 查看镜像仓库基本信息,以下
Step 6: 设置构建规则
上面Dockerfile,来自我本身的git仓库中的代码文件,以下图
最后,单击按钮“当即构建”,执行一次构建,历史记录以下图:
Step 7: 查看构建成功的镜像
单击左边菜单“镜像版本”,以下图。(而且,你也能够单击菜单“安全扫描”,检查镜像安全漏洞)
Step 8, 外部用户,搜索咱们刚才发布的公共镜像mirror_k8s_CoreDNS,以下
最后,聪明的读者朋友,本次利用国内阿里云构建国外Docker镜像版本的方法,就到此成功完成了。
聪明的你,也就能够利用这个方法,来构建其余你须要,可是由于国内局域网不能访问Docker Hub镜像了。