有两种方法让docker 通过Image输出hello world
第一种是通过docker run ubuntu:16.04 /bin/echo "hello world"
其中,run是docker的命令,ubuntu:16.04 是指定要运行的Image,如果本地没有,就从网络上查找并下载到本地。
第二种是通过docker run -i -t ubuntu:16.04 /bin/bash,先在ubuntu:16.04中运行一个shell,然后在shell中通过echo 输出hello world
-t:在ubuntu:16.04 中指定一个终端
-i:允许对ubuntu:16.04 的标准输入进行交互。也就是可以使用终端的意思.