moby / moby/libnetwork

swarm + macvlan + port publish mode=host is not working

Open
#2,050 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
2.2k
Forks
875
PR merge metrics
No merged PRs in 30d

Description

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 : https://github.com/moby/moby/issues/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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented docker service create command with a macvlan network and host-mode port publishing, then trace where the macvlan driver emits “does not support port mappings.” Determine the required behavior and its test coverage; done means the command works as requested or the unsupported combination is explicitly resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.