请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

这样创建自已的image问题出在哪呢?

我的Dockerfile 内容长这样:

FROM ubuntu:16.04
ADD hello.py /
CMD [“python”, “hello.py”]

然后我的 hello.py 内容长这样:

print(“hello~python DOCKER!!!”)

执行 docker build -t uuuboy2003/python-world . 没问题
但是跑 docker run uuuboy2003/python-world 就出错,如图
我想不通是什么问题,base 是ubuntu 16.04 不是就有内建python吗
为什么降执行 python hello.py 却有问题呢?
图片描述

正在回答

1回答

您好,很简单,验证一下就知道了

➜  docker docker run --rm -it ubuntu:16.04 sh
#
#
# python
sh: 3: python: not found
# exit
➜  docker


0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号