[Kubernetes] The method of obtaining Kubernetes image in China

Source: Internet
Author: User

78480241
First, Background introduction

        众所周知,由于国内网络原因,在搭建 Kubernetes 环境时,经常遇到必须的镜像找不到的情况。        到 DockerHub 捡垃圾毕竟不是个好办法,本文就教大家在 DockerHub 搭建自己的镜像仓库。        要求:有 GitHub 账号,有 DockerHub 账号,没有请注册。

Ii. Basic Steps

2.1  登陆 GitHub,创建代码仓库,比如:googlecontainer2.2  克隆代码(地址换成你的)

#git Clone Https://github.com/SataQiu/googlecontainer.git
2.3 Writing Dockerfile (take dashboard as an example)

[Plain] View plain copy
#cd Googlecontainer
#mkdir Dashboard
#cd Dashboard
#vim Dockerfile

From gcr.io/google_containers/kubernetes-dashboard-amd64:v1.7.1
maintainer [email protected]
2.4 Commit Code

#cd < clone code root >
#git Add.
#git commit-m "kubernetes-dashboard-amd64:v1.7.1"
#git push

2.5  最后提交完成后的代码结构

2.6 Login DockerHub, create automated build project

       如未关联账号,会提示绑定 github 账号,按提示操作即可。       如已绑定 github,则选择 github 方式的 Automated Build 项目,       接着按照提示,选择 github 上我们的项目 googlecontainer 即可,仓库名设置为 dashboard2.7  配置 Build Settings       指定 Dockerfile 所在的目录(到目录级即可),设置镜像 tag,先点 Save Changes,再点 Trigger2.8  在 Build Details 可以查看编译进度

2.9 After the compilation is complete, we can pull the image locally.

      自己改一下 tag 就是 gcr.io/google_containers/kubernetes-dashboard-amd64:v1.7.1 镜像了。

[Plain] View plain copy
#docker Pull shidaqiu/dashboard:v1.7.1
#docker tag shidaqiu/dashboard:v1.7.1 gcr.io/google_containers/kubernetes-dashboard-amd64:v1.7.1

[Kubernetes] The method of obtaining Kubernetes image in China

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.