首页 > 解决方案 > Is there any difference between CMD ["./start.sh"] and CMD ./start.sh in docker file?

问题描述

I want to create a docker file in which my API file which is named as start.sh should be running in the background when I run it in the container.Is there any way to do so?

标签: dockerdocker-composedockerfile

解决方案


是的。

文档中,有两种使用方式CMD:作为shell形式,或exec形式。

与 shell 形式不同,exec 形式不调用命令 shell。


推荐阅读