我目前正在进行一个团队项目,利用docker和apache mesos/marathon。为了在mesos/marathon上部署mysql docker容器,我们必须创建一个带有端口Map的json文件。我在互联网上到处搜索,只是找不到任何示例json文件来查找端口Map。以前有人做过吗?
qnyhuwrf1#
下面是一些使用docker桥接网络模式的示例: { "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, "servicePort": 9000, "protocol": "tcp" }, { "containerPort": 161, "hostPort": 0, "protocol": "udp"} ] } } } 请参阅中的“桥接网络模式”部分https://mesosphere.github.io/marathon/docs/native-docker.html 更多细节。
{ "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, "servicePort": 9000, "protocol": "tcp" }, { "containerPort": 161, "hostPort": 0, "protocol": "udp"} ] } } }
1条答案
按热度按时间qnyhuwrf1#
下面是一些使用docker桥接网络模式的示例:
{ "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, "servicePort": 9000, "protocol": "tcp" }, { "containerPort": 161, "hostPort": 0, "protocol": "udp"} ] } } }
请参阅中的“桥接网络模式”部分https://mesosphere.github.io/marathon/docs/native-docker.html 更多细节。