1. Criar arquivo Dockerfile, teste de página index.html
[Root @ localhost Docker] # vi Dockerfile FROM nginx: 1.17.6 # baseado em nginx 1,17, na construção, irá automaticamente puxar uma versão 1.17.6 do nginx ENV LANG en_US.UTF -8 # definir a variável de ambiente a ADD index.html / usr / share / Nginx / HTML adicionando index.html local para o espelho EXPOR 80 # 80 portas abertas EXPOR 443 # à porta aberta 443 [a raiz @localhost Docker] # VI index.html o Olá K8S
Compilar docker
[root @ localhost estivador] # estivador construção. -t Olá-K8S: 0.0.1
executar janela de encaixe Espelho
[root @ localhost estivador] # estivador prazo -d --name hello7001 -p 7001: 80 Hello-K8S: 0.0.1