嗨,我正在马拉松应用程序中运行ubuntu docker,这是我的服务配置:
{
"id": "/h",
"backoffFactor": 1.15,
"backoffSeconds": 1,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "ubuntu",
"forcePullImage": false,
"privileged": true,
"parameters": [{
"key": "detach",
"value": "true"
},
{
"key": "tty",
"value": "true"
},
{
"key": "interactive",
"value": "true"
}
]
}
},
"cpus": 1,
"disk": 10000,
"instances": 0,
"maxLaunchDelaySeconds": 3600,
"mem": 1028,
"gpus": 0,
"networks": [{
"mode": "host"
}],
"portDefinitions": [],
"requirePorts": false,
"upgradeStrategy": {
"maximumOverCapacity": 1,
"minimumHealthCapacity": 1
},
"killSelection": "YOUNGEST_FIRST",
"unreachableStrategy": {
"inactiveAfterSeconds": 0,
"expungeAfterSeconds": 0
},
"healthChecks": [],
"fetch": [],
"constraints": []
}
我试着把…分开 --tty
在后台运行ubuntu容器并使其保持活动状态的选项,还有一件事我尝试了 "cmd": "-sleep 1000000000"
但是 刚开始,任务就一直在完成,不到一秒钟就开始了另一个任务!如何启动docker容器并使其在后台运行?
1条答案
按热度按时间zpgglvta1#
尝试以下配置:
docker容器需要在前台运行的入口点。尝试以下命令: