Turotiral
drivers
containers with static ip
Found two methods:
use bridge (NAT) to utilize static address
use macvlan or IPvlan network driver (without NAT)
Between Macvlan and IPvlan, the latter has advantages such as not needing MAC addresses, which can be useful in large-scale scenarios.
Macvlan is a type of network driver in Docker that allows you to assign a MAC address to a container, making it appear as a physical device on the network. With Macvlan, each container has its own unique MAC address and can be assigned an IP address from the subnet defined by the network configuration. This enables containers to communicate directly with other devices on the network as if they were physical machines.
Using Macvlan in Docker allows you to assign static IP addresses to containers, providing a way to ensure consistent network configurations across container restarts or updates. By defining a custom Macvlan network in your Docker Compose file and specifying static IP addresses for each container, you can achieve the desired network setup with fixed IP assignments.
In summary, Macvlan is a network driver in Docker that enables containers to have their own MAC and IP addresses, making them appear as individual devices on the network. This feature can be utilized to assign static IP addresses to containers, ensuring stable network configurations within a Docker environment.