Docker Community Forums

Share and learn in the Docker community.

Network help: unique IP for each container

Hi folks. I’ve done a lot of googling, and am coming up empty. I know it’s not the standard networking model, but is there a way I can assign each container its own IP accessible to the rest of the network? This is the only way I can think to run two containers on the same host, each with DLNA (plex and unifi-controller). DLNA doesn’t work if you remap ports to arbitrary other ones. I don’t need either of the containers or the host to talk to each other. I’ve been following a few guides that recommend macvlan for this use case, and I’ve used the following in my docker-compose.yml:

version: "3.8"
networks:
  std:
    driver: macvlan
    driver_opts: 
      parent: eth0
    ipam:
      config: 
        - subnet: "192.168.2.0/24"
          gateway: "192.168.2.1"
          ip_range: "192.168.2.0/24"
services:
  unifi:
  ...
  plex:
  ...

The hosts come up just fine, but aren’t routable from my 192.168.1.0/24 main network or the default bridge network. What am I missing?

The secret sauce: macvlan is not supported on DfD.

Well dang. Reading comprehension skills fail. Is there a way to assign independent IPs to containers in windows docker desktop?

This is a question for someone else to answer.