在建立kubernetes集群时须要一些Google云上的镜像
国内拉取不了Google 云上的镜像,因此咱们想到了阿里云,由于阿里云服务器在美国,因此咱们去阿里云上的构建镜像的功能拉取国外的镜像,而后再从阿里云上拉取到本地node
话很少说行动起来
登录阿里云
找到容器服务git
点击管理控制台github
点击建立镜像仓库
填写仓库信息docker
这里若是没有绑定github,先去绑定,点击绑定帐号,跳转到github,点击一下就ok,json
命名空间选择github帐号就行,仓库名写你的dockerfile存放的仓库名,没有先去建立 。个人仓库内容以下图,你们也能够follow我复制个人仓库。
https://github.com/LIUXUCHONG/dockerlibrary服务器
其中images文件夹下是dockerfile目录
每一个目录下有一个dockerfile拉取指定镜像
选中GitHub,这里利用GitHub上的dockerfile建立,也能够选择其余,勾选上海外及其构建。ide
而后会生成一个镜像仓库kubernetes2this
这里我用我原先建立好的kubernetes仓库演示
点击你的仓库名称,而后弹出以下页面,点击构建,添加规则。阿里云
根据要求填写3d
点击确认而后出现一条规则,点击当即建立
而后等待一小会,阿里云仓库就会多了一个pause版本的镜像
其余镜像在原来的规则上修改在构建便可
而后查看镜像版本
而后点击左上角基本信息
这里告诉了咱们如何拉取阿里云仓库上的镜像
首先回到本地机器登录阿里云的仓库
[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-storeLogin 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 ~]#
其他镜像相似