New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support bridged networking mode for Docker containerizer #587
Comments
I think it's worthy to note that Marathon can also do random port selection for you! |
Consider it noted! Here's a sample of the API we'd like to provide: {
"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"}
]
}
},
"healthChecks": [
{
"protocol": "HTTP",
"portIndex": 0,
"path": "/",
"gracePeriodSeconds": 5,
"intervalSeconds": 20,
"maxConsecutiveFailures": 3
}
]
} Here |
Can we also update the env variables available inside the docker container to allow easier lookup of assigned ports? For example it would be convenient to be able to do something like the following:
This also fits in a little better with the docker pattern when linking containers. Here I've started one container running postgres then linked to it from another container and it's easy for my application to lookup the mapped port from the environment variables published into my container.
|
@BenWhitehead tagging the environment variable with the associated container port seems useful, but in your first example wouldn't you want to bind simply to |
Possibly, but also being able to say "bind to what's supposed to be 8080" would allow for host networking to work as well. |
Ah, so this is not necessarily a docker-only issue? As described it seems equally applicable for an arbitrary command running in a cgroups container. |
That's true, maybe it's bigger than the docker networking this issue aims to address. |
Good points though, would you mind adding a separate issue to track this idea? |
Created #588 with an example to keep track |
looks like bridged networking is being moved to mesos 0.21.0. Would be nice to support CLI override for now. |
I build mesos 0.21.0 which supports bridged networking with patch #25270, https://reviews.apache.org/r/25270/. It seems to be working but I'm unable to build marathon using the docker_bridge branch. Getting the same errors as here https://travis-ci.org/mesosphere/marathon/builds/34526949 |
nvm my last comment. I hacked around the problem by using a local maven jar package complied from mesos 0.21.0 with patch 25720 added. I have now a cluster with bridged networking running without problems. |
Great news! The eagle has landed in Mesos: https://reviews.apache.org/r/25270 and will ship with |
0.20.1
. See Mesos JIRA issue 1621.docker_bridge
branch.The text was updated successfully, but these errors were encountered: