Creating Dockerfile

1, create a simple hello workd file

 1 midke /root/hello-world
 2 cd /root/hello-world
 3 
 4 写一个helloworld脚本
 5 vim hello-world.py
 6 #!/usr/bin/env python
 7 print("hello world \n")
 8 
 9 vim Dockerfile
10 FROM python
11 ADD hello-world.py /
12 CMD ["python3","hello-world.py"]
13 
14 生成images
15 docker build -t python-obj/hello-World.
 16  
. 17  to view the generated Images
 18 is  Docker Image LS
 . 19  
20 is  run Images
 21 is Docker RUN-Python obj / Hello World-

 

Guess you like

Origin www.cnblogs.com/YingLai/p/10960451.html