Bind a container in 24.10

Since Truecharts has been removed and metallib follow it. How we can bind a container interface to a specific IP?
I try to install a new container and then editing the compose file to bind the IP instead of 0.0.0.0 but even if looking at “netstat” output it seems to works I can reach the container also on other interfaces.

Any ideas?

You need to add the IP as an IP Alias on the network interface in network settings.

Then if you want to use any ports that the middleware uses, eg 80/443,make sure that the middleware is not binding to that IP.

You need to use a custom compose file via cli/dockge or portainer if you want to bind to a specific ip.

Alternatively, you can use macvlan with docker. This still requires custom compose.

2 Likes

BTW, this is a feature request to add support for binding apps to specific IPs

I did it (not the last macvlan alternative) and that is what I did in first message (probably written too fast).
Now rechecking that I notice that now it works as we thought.
Probably yesterday there was a sort of cache.

Thanks for the feature request! And for your job!