我使用Marathon部署我的Docker集装箱化的node.js应用程序。我的马拉松应用的规格如下:通过mesos-marathon部署集装箱化的node.JS应用程序
{
"id": "<some-name>",
"cmd": null,
"cpus": 1,
"mem": 2800,
"disk": 30720,
"instances": 1,
"container": {
"docker": {
"image": "<some-docker-registry-IP>:5000/<repo>",
"network": "BRIDGE",
"privileged": true,
"forcePullImage": true,
"parameters": [
{
"key": "net",
"value": "host"
}
],
"portMappings": [
{
"containerPort": <some-port>,
"hostPort": <some-port>,
"protocol": "tcp",
"name": null
}
]
},
"type": "DOCKER"
}
}
问题不过是,这将导致在那里部署应用程序,一旦它出现内存不足的重新启动我的服务器。我需要我的服务来监听主机的私有IP,这就是为什么我使用--net=host
。
是否有可能杀死释放内存的任务,以便Marathon可以在不重新启动/关闭服务器的情况下重新生成它?或者有没有其他方法可以让Docker容器在不使用--net=host
的情况下与外部路由可路由?