Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何判断我的Docker图像是否符合我的要求?_Docker - Fatal编程技术网

如何判断我的Docker图像是否符合我的要求?

如何判断我的Docker图像是否符合我的要求?,docker,Docker,我有以下Dockerfile: FROM rocker/r-base COPY ./hello.R /tmp/hello.R CMD R CMD BATCH /tmp/hello.R hello.R如下所示: print("hello world") docker run my-images/testing 我可以很好地构建图像,但当我这样运行它时: print("hello world") docker run my-images/testing 我看不到输出。docker映像向

我有以下Dockerfile:

FROM rocker/r-base

COPY ./hello.R /tmp/hello.R

CMD R CMD BATCH /tmp/hello.R
hello.R
如下所示:

print("hello world")
docker run my-images/testing
我可以很好地构建图像,但当我这样运行它时:

print("hello world")
docker run my-images/testing
我看不到输出。docker映像向上旋转、运行,然后终止


如何知道脚本是否正在运行?我如何测试它是否按预期工作?

您可能只需要设置
--interactive
标志:

docker run -i my-images/testing