Open NonaSuomy opened 8 months ago
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. When I update the stack afterwards, the containers get the correct MAC.
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. Also need to recreate them manually with the right mac, which kind of defeats the purpose of watchtower for the macvlan ones. No complain for bridge containers since mac address changes are irrelevant in that context.
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
Server: Engine: Version: 25.0.3 API version: 1.44 (minimum version 1.24) Go version: go1.22.0 Git commit: f417435e5f Built: Thu Feb 29 20:50:13 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.7.13 GitCommit: 7c3aca7a610df76212171d200ca3811ff6096eb8.m runc: Version: 1.1.12 GitCommit: docker-init: Version: 0.19.0 GitCommit: de40ad0