通过阿里云拉取Google云上的镜像

在创建kubernetes集群时需要一些Google云上的镜像
国内拉取不了Google 云上的镜像,所以我们想到了阿里云,因为阿里云服务器在美国,所以我们去阿里云上的构建镜像的功能拉取国外的镜像,然后再从阿里云上拉取到本地

话不多说行动起来
登陆阿里云
找到容器服务

通过阿里云拉取Google云上的镜像

点击管理控制台

通过阿里云拉取Google云上的镜像

点击创建镜像仓库
通过阿里云拉取Google云上的镜像
填写仓库信息

通过阿里云拉取Google云上的镜像

这里如果没有绑定github,先去绑定,点击绑定账号,跳转到github,点击一下就ok,

通过阿里云拉取Google云上的镜像

命名空间选择github账号就行,仓库名写你的dockerfile存放的仓库名,没有先去创建 。我的仓库内容如下图,大家也可以follow我复制我的仓库。
https://github.com/LIUXUCHONG/dockerlibrary
通过阿里云拉取Google云上的镜像

其中images文件夹下是dockerfile目录
通过阿里云拉取Google云上的镜像
每个目录下有一个dockerfile拉取指定镜像
通过阿里云拉取Google云上的镜像
选中GitHub,这里利用GitHub上的dockerfile创建,也可以选择其他,勾选上海外及其构建。
通过阿里云拉取Google云上的镜像

然后会生成一个镜像仓库kubernetes2

通过阿里云拉取Google云上的镜像

这里我用我原先创建好的kubernetes仓库演示
点击你的仓库名称,然后弹出如下页面,点击构建,添加规则。

通过阿里云拉取Google云上的镜像
根据要求填写

通过阿里云拉取Google云上的镜像
点击确认然后出现一条规则,点击立即创建

通过阿里云拉取Google云上的镜像
然后等待一小会,阿里云仓库就会多了一个pause版本的镜像
通过阿里云拉取Google云上的镜像

其他镜像在原来的规则上修改在构建即可通过阿里云拉取Google云上的镜像
然后查看镜像版本
通过阿里云拉取Google云上的镜像

然后点击左上角基本信息通过阿里云拉取Google云上的镜像

这里告诉了我们如何拉取阿里云仓库上的镜像
首先回到本地机器登陆阿里云的仓库

[root@node01 yum.repos.d]# docker login --username=<你的名字> registry.cn-hangzhou.aliyuncs.com
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@node01 yum.repos.d]#

注意这里的密码并不是你阿里云的登陆密码,而是你开通服务时的密码
接下来拉取镜像并重新tag

[root@node01 ~]# docker pull registry.cn-hangzhou.aliyuncs.com/aliyunlxc/kubernetes:pause
pause: Pulling from aliyunlxc/kubernetes
7675586df687: Pull complete
Digest: sha256:fcaff905397ba63fd376d0c3019f1f1cb6e7506131389edbcb3d22719f1ae54d
Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/aliyunlxc/kubernetes:pause
[root@node01 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.cn-hangzhou.aliyuncs.com/aliyunlxc/kubernetes pause da86e6ba6ca1 17 months ago 742kB
[root@node01 ~]#
[root@node01 ~]# docker tag registry.cn-hangzhou.aliyuncs.com/aliyunlxc/kubernetes:pause k8s.gcr.io/pause:3.1[root@node01 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/pause 3.1 da86e6ba6ca1 17 months ago 742kB
registry.cn-hangzhou.aliyuncs.com/aliyunlxc/kubernetes pause da86e6ba6ca1 17 months ago 742kB
[root@node01 ~]#

其余镜像类似

猜你喜欢

转载自blog.51cto.com/13670314/2397600