可乐加可乐冰 2022-03-27 19:31 采纳率: 0%
浏览 15

CMD "文件"和CMD["文件",run]的区别

dockerfile 部署tomcat的时候,看网上很多教学 dockerfile 中有这个一个命令

CMD ["/usr/local/apache-tomcat-9.0.60/bin/catalina.sh","run"]

那么和下面这个有什么区别呢?

CMD /usr/local/apache-tomcat-9.0.60/bin/catalina.sh
  • 写回答

1条回答 默认 最新

  • 狂龙骄子 2022-03-27 19:54
    关注

    run 在当前shell窗口运行,命令行输出日志时用。

    具体查看 tomcat 的catalina.sh 参数用法:

    Usage: catalina.sh ( commands ... )
    
    commands:
      debug             Start Catalina in a debugger
      debug -security   Debug Catalina with a security manager
      jpda start        Start Catalina under JPDA debugger
      run               Start Catalina in the current window
      run -security     Start in the current window with security manager
      start             Start Catalina in a separate window
      start -security   Start in a separate window with security manager
      stop              Stop Catalina, waiting up to 5 seconds for the process to end
      stop n            Stop Catalina, waiting up to n seconds for the process to end
      stop -force       Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running
      stop n -force     Stop Catalina, wait up to n seconds and then use kill -KILL if still running
      configtest        Run a basic syntax check on server.xml - check exit code for result
      version           What version of tomcat are you running?
    Note: Waiting for the process to end and use of the -force option require that $CATALINA_PID is defined
    

    源码中的参数截图

    img

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 3月27日

悬赏问题

  • ¥20 access中怎么分割分别获取一下图中的值
  • ¥15 keras_tcn已经安装成功,还是显示ModuleNotFoundError: No module named 'keras_tcn'
  • ¥15 类图中关联与聚合的区别
  • ¥15 ENVI高分五号去除云层的方法
  • ¥15 16进制数据如何得到奇偶校验位
  • ¥15 求合并两个字节流VB6代码
  • ¥15 Pyqt 如何正确的关掉Qthread,并且释放其中的锁?
  • ¥30 网站服务器通过node.js部署了一个项目!前端访问失败
  • ¥15 WPS访问权限不足怎么解决
  • ¥15 java幂等控制问题