How to obtain a Kubernetes image in China
I. background
As we all know, due to domestic network reasons, when building a Kubernetes environment, we often encounter situations where necessary images cannot be found. After all, it is not a good way to pick up junk in DockerHub. This article will teach you how to build your own image repository in DockerHub.
Requirement: You have a GitHub account and a DockerHub account. If not, register.
Ii. Basic Steps
2.1 log on to GitHub and create a code repository, such as googleiner iner.
2.2 clone code (replace the address with yours)
# Git clone https://github.com/SataQiu/googlecontainer.git
2.3 compile Dockerfile (take dashboard as an example)
# Cd googleiner iner
# Mkdir dashboard
# Cd dashboard
# Vim Dockerfile
FROM gcr. io/google_containers/kubernetes-dashboard-amd64: v1.7.1
MAINTAINER qiushida@buaa.edu.cn
2.4 submit code
# Cd <clone code root directory>
# Git add.
# Git commit-m "kubernetes-dashboard-amd64: v1.7.1"
# Git push
2.5 code structure after the final submission is complete
2.6 log on to DockerHub and create an automatic Build project
If no account is associated, you will be prompted to bind the github account and follow the prompts.
If github has been bound, select the github-based Automatic Build project,
Follow the prompts and select our project googleiner iner on github. Set the repository name to dashboard.
2.7 configure Build Settings
Specify the directory where Dockerfile is located (to the directory level), set the Image tag, click Save Changes, and then click Trigger
2.8 check the compilation progress in Build Details
2.9 After compilation, we can pull the image locally.
Change the tag is gcr. io/google_containers/kubernetes-dashboard-amd64: v1.7.1 image.
# Docker pull shidaqiu/dashboard: v1.7.1
# Docker tag shidaqiu/dashboard: v1.7.1 gcr. io/google_containers/kubernetes-dashboard-amd64: v1.7.1
CentOS 7.3 use kubeadm to install Kubernetes 1.7.3 full version
This article permanently updates link: https://www.bkjia.com/Linux/2018-02/151015.htm