Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-4001

Getting my head around ports with marathon + docker

    Details

    • Type: Task
    • Status: Resolved
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      In the docker container JSON, portMappings is an array of objects containing:

      {containerPort, hostPost, servicePort and protocol}

      .

      Correct me if I'm wrong here:

      • containerPort is the port the app listens on in the container
      • hostPort is the port that clients should connect to, which is redirected into the container at containerPort. If zero, marathon chooses a random unused port.

      What's servicePort then? The docs say it's for service discovery but there isn't any detail about how to utilise it.

      Also the "ports" array in the JSON outside the container section. I gather the values in this array need to be the corresponding values of hostPort inside "portMappings".

      Finally it looks like the values in ports[] are passed into the container as $PORT0, $PORT1, $PORT2 etc (where $PORT = $PORT0). Is there anywhere the container is told the values of containerPort?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              GitHub_nickandrew Nick Andrew (Inactive)
              Team:
              Orchestration Team
              Watchers:
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: