【发布时间】:2018-02-28 20:55:42
【问题描述】:
我想在自定义端口上使用 Mesos 框架启动 docker 容器,但不知道如何公开端口?我无法在桥接网络中启动 docker 容器。我向调度程序发送接受请求,如下所示:
{
"framework_id":{"value":"FRAMEWORK_ID"},
"type":"ACCEPT",
"accept":{
"offer_ids":[{"value":"SOME ID"}],
"operations":[
{
"type":"LAUNCH",
"launch":{
"task_infos":[
{
"name":"My Task",
"task_id": {"value": "12220-3440-12532-my-task"},
"agent_id":{"value": "AGENT_ID"},
"command": {"shell": false},
"container":{
"type":"DOCKER",
"docker":{
"image":"someimage/chrome",
"network":"BRIDGE"
}
},
"resources":[
{
"name":"cpus",
"type":"SCALAR",
"scalar":{"value":1.0}
},
{
"name":"mem",
"type":"SCALAR",
"scalar":{"value":128.0}
}
]
}
]
}
}
],
"filters":{"refuse_seconds":5.0}
}
}
我不能使用 Marathon,所以这样的东西不起作用:
"portMappings": [
{
"containerPort": 8080,
"hostPort": 0,
"servicePort": 11044,
"protocol": "tcp",
"labels": {}
}
]
这个问题有解决办法吗?
【问题讨论】: