Mesos无法从私有Docker注册表部署容器 [英] Mesos cannot deploy container from private Docker registry

查看:133
本文介绍了Mesos无法从私有Docker注册表部署容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个私有Docker注册表,可通过 https://docker.somedomain.com 访问(通过标准端口443,而不是5000).我的基础架构包括Mesosphere的设置,其中启用了Docker容器化程序.我正在尝试通过Marathon将特定的容器部署到Mesos从属服务器;但是,这总是失败的,因为Mesos几乎立即使任务失败,并且该沙箱的stderr和stdout中没有数据.

I have a private Docker registry that is accessible at https://docker.somedomain.com (over standard port 443 not 5000). My infrastructure includes a set up of Mesosphere, which have docker containerizer enabled. I'm am trying to deploy a specific container to a Mesos slave via Marathon; however, this always fails with Mesos failing the task almost immediately with no data in stderr and stdout of that sandbox.

我尝试从标准Docker Registry中的映像进行部署,它似乎运行良好.我在弄清楚出什么问题时遇到了麻烦.我的私有Docker注册表不需要密码身份验证(为了调试而关闭),并且如果我以Meso的从属实例为外壳,并且以sudo su作为根用户,则可以运行``docker pull docker.somedomain.com/services/myapp''每次都成功.

I tried deploying from an image from the standard Docker Registry and it appears to work fine. I'm having trouble figuring out what is wrong. My private Docker registry does not require password authentication (turned off for debugging this), AND if I shell into the Meso's slave instance, and sudo su as root, I can run a 'docker pull docker.somedomain.com/services/myapp' successfully every time.

这是我开始任务的马拉松发布数据:

Here is my Marathon post data for starting the task:

{
  "id": "myapp",
  "cpus": 0.5,
  "mem": 64.0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "docker.somedomain.com/services/myapp:2",
      "network": "BRIDGE",
      "portMappings": [
        { "containerPort": 7000, "hostPort": 0, "servicePort": 0, "protocol": "tcp" }
      ]
    },
    "volumes": [
      {
        "containerPath": "application.yml",
        "hostPath": "/var/myapp/application.yml",
        "mode": "RO"
      }
    ]
  },
  "healthChecks": [
    {
      "protocol": "HTTP",
      "portIndex": 0,
      "path": "/",
      "gracePeriodSeconds": 5,
      "intervalSeconds": 20,
      "maxConsecutiveFailures": 3
    }
  ]
}   

我已经坚持了将近一天,我尝试过的一切似乎都产生了相同的结果.任何对此的见解将不胜感激.

I've been stuck on this for almost a day now, everything I've tried seems to be yielding the same result. Any insights on this would be much appreciated.

我的版本: 中观0.22.1 马拉松:0.8.2 码头工人:1.6.2

My versions: Mesos: 0.22.1 Marathon: 0.8.2 Docker: 1.6.2

推荐答案

因此,这实际上是卷的问题

So this turns out to be an issue with volumes

"volumes": [
      {
        "containerPath": "/application.yml",
        "hostPath": "/var/myapp/application.yml",
        "mode": "RO"
      }
    ]

在docker中使用根路径容器的根路径可能是合法的,但Mesos似乎无法处理此行为.将containerPath修改为非根路径可以解决此问题,即

Using the root path of the container of the root path may be legal in docker, but Mesos appears not to handle this behavior. Modifying the containerPath to a non-root path resolves this, i.e

"volumes": [
      {
        "containerPath": "/var",
        "hostPath": "/var/myapp",
        "mode": "RW"
      }
    ]

这篇关于Mesos无法从私有Docker注册表部署容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆