I'm using 1Panel to manage my Docker containers, but I'm facing an issue where their IP addresses keep changing. Right now, I have them set to use a bridge network. Is there a way to configure them so that their IP addresses stay fixed and don't disrupt my services?
4 Answers
It sounds like you're dealing with an XY problem. What exactly is happening? For instance, if your containers' IPs change and then your domain name doesn't point to the new IP, that can cause issues.
You might want to look into creating a custom network. This way, you can define specific IPs for your containers, but an even better approach is to use DNS and refer to the containers by their names instead.
Generally, it's not a good idea to try and assign static IPs to Docker containers since they're designed to be ephemeral. But if you really need them to keep the same IP address, you can set up static addresses in the IPAM settings for the containers' network. Make sure the DHCP pool range is smaller than the subnet range and excludes any static IPs you assign.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures