Docker Community Forums

Share and learn in the Docker community.

Static IP on Docker containers

Hello,

I am currently using Docker on my synology. After each reboot of my synology, my containers get a random IP in the 172.17.0.0/16 pool.

I would like to be able to set the ips of my containers without having to create a new macvlan network.
The macvlan might cause me some communication problems between my containers.

Thanks in advance for your feedback.

Hi, I just tried to install docker on my synology, and it dosnt seem like it supports creating static ip for a network.

What you would do is creating a network manually, and then tell the container to use this network, using an ip you defined.

But this is possible if you ssh to the synology and use docker by cli.

Thank you for your reply.

The problem of using SSH is that my docker images are already in use with environment variables.

What is the solution ?

Do I have to make a docker composed of each docker with environment variables and then add the notion of static ip?

Thanks

Not sure what you mean by “docker images are already in use with environment variables”.

Do I have to make a docker composed of each docker with environment variables and then add the notion of static ip?

Yes, then you add a static ip to that yml file