Aurora: docker参数中的未知模式



我有一个aurora文件,其中包含以下docker参数:

jobs = [
  Service(cluster = 'mesos-fr',
      environment = 'devel',
      role = 'root',
      instances = 1,
      name = 'frontend_service',
      task = run_frontend_service,
      container=Docker(image='frontend_service', parameters=[{'name': 'frontend_service'}, {'publish': '{{thermos.ports[http]}}:3000'}])
  )
]

得到这个错误:

Error loading configuration: Unknown schema attribute publish

是否有连接主机端口与docker容器端口的解决方案?

编辑:Mustache变量替换可能没有帮助,因为它们发生在容器出现之后。

看起来你的Docker参数的形式有问题。正确的例子是container=Docker(image='nginx', parameters=[Parameter(name='env', value='HTTP_PORT={{thermos.ports[http]}')])

存在一个Parameter对象,有namevalue。Value可以是一个带有mustache变量的字符串(就像ports),所以你可以把这些东西扔进去。

这个文档(在Announcer Objects下)可能也有帮助:http://aurora.apache.org/documentation/latest/reference/configuration/

最新更新