我正在尝试在我的基础设施上启动rstudio.
如果我做 :
sudo docker run -d -p 8787:8787 192.168.0.38:5000/rocker/rstudio
然后我的rstudio在我的服务器上正常运行.但我有mesos和马拉松,并希望用这个docker命令制作一个Marathon的应用程序.
我找不到正确映射端口的方法.
我试过了 :
{ "type": "DOCKER", "volumes": [], "docker": { "image": "192.168.0.38:5000/rocker/rstudio", "network": "HOST", "privileged": true, "parameters": [ { "key": "p", "value": "8787:8787" } ], "forcePullImage": true } }
跳跃我会工作,但它永远不会开始.
我试过了:
{ "type": "DOCKER", "volumes": [], "docker": { "image": "192.168.0.38:5000/rocker/rstudio", "network": "HOST", "portMappings": [ { "containerPort": 8787, "hostPort": 8787, "servicePort": 10003, "protocol": "tcp" } ], "privileged": true, "parameters": [], "forcePullImage": true } }
哪个不是更好.
你建议我转换这个工作的docker命令哪个json:
sudo docker run -d -p 8787:8787 192.168.0.38:5000/rocker/rstudio
??
端口映射(与Docker一样)仅与BRIDGE
网络模式相关,另请参阅Marathon doc.在您的情况下,以下应该工作:
... "container": { "type": "DOCKER", "docker": { "network": "BRIDGE", "portMappings": [ { "protocol": "tcp", "containerPort": 8787, "hostPort": 8787 } ] } }, ...