-
Notifications
You must be signed in to change notification settings - Fork 300
FAQ with Answers
Brenden Matthews edited this page Jul 12, 2016
·
1 revision
Yes, of course! Most of the examples and documentation only show examples with Docker bridge networking (NAT) enabled. This is merely because it's more convenient. Here's a sample Python HTTP server which uses host networking, binding to $PORT0, and exposing the service on port 10010:
{
"id": "/http-derp-pants-python",
"cmd": "python -m http.server $PORT0",
"cpus": 0.1,
"mem": 32,
"instances": 2,
"container": {
"type": "DOCKER",
"docker": {
"image": "python:3",
"network": "HOST"
}
},
"healthChecks": [
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 30,
"intervalSeconds": 6,
"timeoutSeconds": 2,
"maxConsecutiveFailures": 3
}
],
"labels": {
"HAPROXY_GROUP": "external"
},
"portDefinitions": [
{
"port": 10010,
"protocol": "tcp"
}
]
}
For more details on port handling in Marathon, check the Marathon documentation.
Yes, but it will break certain features due to how the current implementations work. Here is a demo of using MLB with nginx and HTTP/2.