shell - Mesos Marathon Docker容器-CommandInfo

标签 shell docker mesos marathon

最近,我在多个节点上设置了Marathon,Mesos和Docker。一切运行良好,除了启动Docker容器时遇到问题。具体来说,当Marathon执行启动Docker容器的任务时,marathon会将/bin/sh -c ' '附加为默认Docker命令。这将导致我的容器启动,然后立即退出(我可以看到它们是使用docker ps -a启动的)
我看了一下Mesos文档,该文档指出:

A docker image currently supports having an entrypoint and/or a default command.

To run a docker image with the default command (ie: docker run image), the CommandInfo’s value must not be set. If the value is set then it will override the default command.

To run a docker image with an entrypoint defined, the CommandInfo’s shell option must be set to false. If shell option is set to true the Docker Containerizer will run the user’s command wrapped with /bin/sh -c which will also become parameters to the image entrypoint.


这是很好的信息(我从Mesos中看到了预期的行为),但是在Marathon中没有看到关闭CommandInfo shell的选项。
enter image description here
我的问题是:
  • 如何将CommandInfo Shell选项(在Marathon或Mesos中)设置为false?需要在哪里设置?

  • 当我在计算机上运行ghost-blog-test镜像时(使用标准docker run命令),它将/entrypoint.sh npm s作为其默认命令。使用Mesos + Marathon时,我希望得到相同的行为。
    提前致谢!

    最佳答案

    由于问题(#2147),您需要定义命令,否则只需指定命令即可解决问题,并运行默认docker入口点。
    相关错误已在最新(0.13)版本中修复,但您需要使用API​​,因为UI仍然存在问题(#2749)。

    关于shell - Mesos Marathon Docker容器-CommandInfo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33986271/

    相关文章:

    docker - 如何在Marathon中指定Docker容器的IP?

    docker - 将 'Docker Run' 选项传递给 Mesos/Marathon/Chronos

    bash - 如果这些 Perl 命令在粘贴到 shell 中时被解释为 Bash 命令,是否有害?

    json - 如何从 linux shell 脚本中的 json 键值对获取值

    docker - 如何在重启或尝试失败后自动重启带有 compose 的 docker 容器?

    amazon-web-services - 如何使用 Docker for Mac 向 docker awslogs 驱动程序提供凭据?

    amazon-web-services - Mesos - 动态集群大小

    bash - shell 脚本中的 while 条件在条件检查中带有 -h

    c - 系统 ("echo text > t.log") 报告错误

    php - 建立与CakePHP数据库的连接时出错