-
Notifications
You must be signed in to change notification settings - Fork 906
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
Not properly applying container.networks.mac_address gives random MAC #1941
Comments
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏 |
Same behavior with me. After watchtower updates a container, which has a static MAC address (from compose.yaml in networks section), the updated container changes its MAC address based on the IP-address (02:42:....) and not the defined one. But if I manually update by "docker compose down; docker compose up" I get the static MAC address again. |
Any news if there will be a fix for this? |
I have the same problem. I have some stacks with fixed MAC addresses for the containers, but every time Watchtower recreates them, this MAC is not used. |
Found this issue with a web search as am facing the same problem with macvlan containers getting new random mac addresses when watchtower updates them. |
Same issue for me, getting random MAC address after watchtower upgrades instead of the fixed one I set. |
Quite sad that still no one is looking into it :( |
Describe the bug
I have 30 dockers that obtain their IP address by static set MAC addresses that get DHCP dished out by dnsmasq that are set in the dnsmasq config.
dnsmasq.conf
Watchtower is deployed like this:
They have recently changed where you put mac_address: in docker engine v25 to under the network section:
https://docs.docker.com/compose/compose-file/05-services/#mac_address-1
Here is an example of the old mac_address usage:
Name: testmac
The new way example:
Steps to reproduce
My containers get deployed from portainer which after upgrading their internal usage of docker-compose to the latest version solved this problem of not accepting mac_address at all and giving you a random MAC address.
After that, I was like yay problems are gone. Then I got an email from watchtower that the containers were updated... which then gave them all random MAC addresses again which then gave random IPs instead of their static set ones.
I jumped back in portainer and redeployed the stacks and boom MAC Address set to their proper static address again.
Rinse and repeat watchtower runs, random MACs again.
Expected behavior
Static set MAC addresses getting properly set.
Screenshots
No response
Environment
The text was updated successfully, but these errors were encountered: