1. Create Dockerfile file, index.html page test
[root @ localhost Docker] # vi Dockerfile the FROM nginx: 1.17.6 # based on nginx 1.17, in the build, will automatically pull a 1.17.6 version of nginx ENV LANG en_US.UTF -8 # set the environment variable the ADD index.html / usr / Share / Nginx / HTML adding local index.html to the mirror EXPOSE 80 # 80 open ports EXPOSE 443 # to open port 443 [the root @localhost Docker] # VI index.html the Hello K8S
Compile docker
[root@localhost docker]# docker build . -t hello-k8s:0.0.1
run docker Mirror
[root@localhost docker]# docker run -d --name hello7001 -p 7001:80 hello-k8s:0.0.1