Docker + Marathon: how to do port mapping?

I am trying to run rstudio on my infrastructure.

If I do this:

sudo docker run -d -p 8787:8787 192.168.0.38:5000/rocker/rstudio

Then rstudio runs on my server. But I have a meso and a marathon, and I want to make a Marathon app from this docker team.

I cannot find a way to display the port correctly.

I tried:

{
  "type": "DOCKER",
  "volumes": [],
  "docker": {
    "image": "192.168.0.38:5000/rocker/rstudio",
    "network": "HOST",
    "privileged": true,
    "parameters": [
      {
        "key": "p",
        "value": "8787:8787"
      }
    ],
    "forcePullImage": true
  }
}

I repeat that I will work, but it never starts.

And I tried:

{
  "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
  }
}

Which is not better.

Which json do you suggest me convert this docker working command:

sudo docker run -d -p 8787:8787 192.168.0.38:5000/rocker/rstudio

??

+4
source share
1 answer

( Docker), BRIDGE, . Marathon. :

...
"network": "BRIDGE",
"portMappings": [
  {
    "containerPort": 8787,
    "hostPort": 8787
  }
...
+7

Source: https://habr.com/ru/post/1623662/


All Articles