How to create a multi-homed Docker container from command-line?


(I had posted this earlier on SuperUser.)

How do I create 2 NICs in a Docker container, each having a different MAC address, from outside of the container, when the container is created / spawned off for the first time?

That is, using the host’s command-line interface to Docker, and not that of the OS running within the container.

If I use --mac-address=... twice, only the second value is accepted resulting in a single-homed container.

Usecase: I have a legacy server application - whose source code I don’t have access to - that I’m trying to dockerize, and that needs the presence of 2 NICs: 1 NIC it uses to tie its license to, and the other NIC it uses to communicate with database etc :frowning: