title: Docker + Marathon : how to do a port mapping ?
body: <p>I am trying to launch rstudio on my infrastructure.</p>
  
  <p>If I do : </p>
  
  <pre><code>sudo docker run -d -p 8787:8787 192.168.0.38:5000/rocker/rstudio
  </code></pre>
  
  <p>Then I have rstudio running fine on my server.
  But I have mesos and marathon, and would like to make a Marathon's app out of this docker command.</p>
  
  <p>I can't find the way to map correctly the port.</p>
  
  <p>I tried : </p>
  
  <pre><code>{
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "192.168.0.38:5000/rocker/rstudio",
      "network": "HOST",
      "privileged": true,
      "parameters": [
        {
          "key": "p",
          "value": "8787:8787"
        }
      ],
      "forcePullImage": true
    }
  }
  </code></pre>
  
  <p>Hopping that I would work, but it never starts.</p>
  
  <p>And I tried : </p>
  
  <pre><code>{
    "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
    }
  }
  </code></pre>
  
  <p>Which is not better.</p>
  
  <p>Which json would you suggest me to convert this working docker command : </p>
  
  <pre><code>sudo docker run -d -p 8787:8787 192.168.0.38:5000/rocker/rstudio
  </code></pre>
  
  <p>??</p>