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
swarm + macvlan + port publish mode=host is not working #2050
Comments
In case of macvlan, the container IPs are directly accessible from outside the host (without having to go through NAT). So publishing ports in macvlan is not necessary and we report an error when you try to publish. |
Indeed, the service ports are already accessible directly through it's IP inside the macvlan network. |
More details : this would be useful when you want high performance networking between your containers (by using macvlan on a dedicated network for clustering instead of the slower overlay network), and high performance ingest (by using a simple iptables rules that DNAT the traffic on each node the service is running instead of the slower standard swarm ingress), also working around moby/moby#25526. For now I need to script the iptables DNAT rules creation outside of docker, with a lookup of the local container ip (which is dynamic). Currently, as soon as the container is present in at least 1 macvlan network, no ports mapping is performed. Even if you put that container in multiple network and in the default network too. |
I encountered two variants of this problem (just using Docker Engine, not Swarm), I would be greatly appreciative if this could be resolved:
|
Trying to publish ports using the "host" mode on my swarm service, but it seems it's not supported when using a macvlan network driver.
We get logs like "macvlan driver does not support port mappings".
I need this to workaround this issue : moby/moby#25526
This is not working if "mynetwork" is macvlan based :
docker service create --network mynetwork --publish mode=host,target=80,published=80,protocol=tcp --name=web --mode=global nginx:alpine
The text was updated successfully, but these errors were encountered: