I found an answer to my own question. I guess I need marathon 0.7.1.

And than use the format below:

{
  "id": "bridged-webapp",
  "cmd": "python3 -m http.server 8080",
  "cpus": 0.5,
  "mem": 64.0,
  "instances": 2,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "python:3",
      "network": "BRIDGE",
      "portMappings": [
        { "containerPort": 8080, "hostPort": 0, "protocol": "tcp"},
        { "containerPort": 161, "hostPort": 0, "protocol": "udp"}
      ]
    }
  }



--
Thanks,
Yoni.

PGP Public Key <http://cdn.nextaudiobook.com/cigan1_pub_gpg.txt>

On Tue, Sep 30, 2014 at 5:06 PM, Yonatan Ryabinski <[email protected]> wrote:

> Hey,
>
> How can one expose docker ports via marathon? There is the ports key of
> the .json file but that doesn't seem to expose the docker ports.
>
> Please advise.
>
>
> --
> Thanks,
> Yoni.
>
> PGP Public Key <http://cdn.nextaudiobook.com/cigan1_pub_gpg.txt>
>
> On Tue, Sep 30, 2014 at 4:32 PM, Steve Domin <[email protected]> wrote:
>
>> Hi Luyi,
>>
>> By "how internally these instances are connected" do you refer to some
>> kind of service discovery? If so, there's nothing really built into
>> Marathon for that, you'll have to use another service.
>>
>> There's a script provided by Marathon
>> <https://github.com/mesosphere/marathon/blob/master/bin/haproxy-marathon-bridge>
>> that updates an HAProxy config but it means you'd have to put your database
>> behind HAProxy, which may or may not work in your case.
>>
>> Steve
>>
>> On Tue, Sep 30, 2014 at 7:47 PM, Luyi Wang <[email protected]>
>> wrote:
>>
>>> Hey all :
>>>
>>>
>>> My question is  what's the best way to running mysql or postgresq on
>>> mesos with marathon.
>>>
>>> I saw my posts just mentioned the way doing the scale using marathon,
>>> but didn't explain how internally these instances are connected ?
>>>
>>> Can anyone point out the places I can refer to or give me some insights
>>> on this.
>>>
>>> Thanks.
>>>
>>>
>>>
>>>
>>> -Luyi.
>>>
>>>
>>>
>>>
>>
>

Reply via email to