8000 Question: How does port pairing work? · Issue #48 · mesosphere-backup/deimos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Question: How does port pairing work? #48
Open
@tnolet

Description

@tnolet

Was looking around how to map multiple exposed ports to marathon/mesos ports using deimos. I was surprised by the following:

Starting a container that exposes ports 8080 and 8081, I (naively) assigned two ports in my json file:

{
    "container": {
    "image": "docker:///tnolet/hello:1.0",
    "options" : ["-P"]
  },
  "id": "hello2",
  "instances": "1",
  "cpus": ".5",
  "mem": "512",
  "uris": [],
  "cmd": "",
  "ports" : [40195,40196]
}

However, this resulted in deimos picking and auto incrementing two ports, 31267 and 31268:

Jul 31 17:17:17 ec2-54-84-57-179 deimos[5707]: deimos.docker.run() Port pairings (Mesos, Docker) // [(31627, 8080), (31628, 8081)]
Jul 31 17:17:17 ec2-54-84-57-179 deimos[5707]: deimos.containerizer.docker.launch() call // docker run --sig-proxy --rm --cidfile /tmp/deimos/mesos/54f421fd-0935-4f34-8be9-33a17862024e/cid -w /tmp/mesos-sandbox -v /tmp/deimos/mesos/54f421fd-0935-4f34-8be9-33a17862024e/fs:/tmp/mesos-sandbox -P -p 31627:8080 -p 31628:8081 -c 512 -m 512m -e PORT=31627 -e PORT0=31627 -e PORTS=31627,31628 -e PORT1=31628 tnolet/hello:1.0

If I leave the "port" key out of my json file, deimos only maps the lowest numbered port.
I love the auto incremented ports, but I'm not sure how this is triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0