Publish service port in host mode
See original GitHub issueHello,
I’m trying to create a service publishing a port in host mode with the Python SDK, but i don’t see option to do so 😦
It is possible via docker command line (https://docs.docker.com/engine/reference/commandline/service_create/#options) :
docker service create -p mode=host,published=80,target=80 --name test httpd
It is also possible via docker-compose:
services:
test:
image: httpd
ports:
- mode: host
target: 80
published: 80
deploy:
mode: replicated
replicas: 1
Is there a way to achieve the same result via python SDK ?
Thanks !
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Deploy services to a swarm - Docker Documentation
To publish a service's port directly on the node where it is running, use the mode=host option to the --publish flag. Note: If...
Read more >Publish port in Docker Swarm host network - Stack Overflow
host mode port publishing exposes ports only on the host where specific service tasks are running. The port is mapped directly to the ......
Read more >Understanding Docker's -net=host Option | MetricFire Blog
In this post we will learn briefly about various networking modes available for Docker containers and deep dive into Host Mode networking.
Read more >Docker port publish host mode and iptables - Server Fault
It works, but also opens all containers with 'host' port publishing like 64321:80 to the world. I have no clue how to filter...
Read more >Networking - Container Orchestration With Docker Swarm ...
Host mode publishing is useful when you have an external service discovery service and potentially for global services where one task for a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jgeryk I believe you are mistaken.
I don’t know how I missed that. Thank you!