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.
Running containers inside custom network provide you ability to sign containers with names, and use these names as DNS, avoiding IP utilization, like - docker network create mysupernetwork, docker run -d MyImageName (any other options) --name backend --network mysupernetwork and get access to it via http://backend from any other containers inside this network instead of http://127.17.0.1:8080 or whatever.
If you really need to have a stable IP you have to run containers in the same order each time. For example it could be done with the docker-compose.yml where you will make a Chain for all containers using depends_on option.
This is litteraly an option provided by the compose file format:
It is possible to either assign fixed ipv4 and/or ipv6 ips for each network a conatiner is member of.
Though, if you depend on fix ip addresses, you high likely do something in way it is not supposed to be used. For container to container communication the prefered way is to use service discovery, which will allow to resolve the service names within a user defined network (like @pavelshalahai indicated). For outside to container communication you need to publish the container port and use the host ip or name and the host port of port mapping.