Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Preventing port clash by using macvlan - howto #21

Open
time4tea opened this issue Jan 1, 2019 · 1 comment
Open

Preventing port clash by using macvlan - howto #21

time4tea opened this issue Jan 1, 2019 · 1 comment

Comments

@time4tea
Copy link

time4tea commented Jan 1, 2019

Hi,

I also want to use plex on the same box that runs LMS, and so cannot use host networking - which was the easiest networking mode to get working - because of port clash. The default bridge networking mode seemed to advertise the container IP address of 172.xxx.xxx.xxx which seemed to defeat autodiscovery.

Anyhow, I managed to get macvlan networking working, so thought others may appreciate an example.

# The "init:" keyword, below, requires either version "2.2"
# or "2.3".
version: "2.3"

services:
  squeeze:
    image: larsks/logitech-media-server:7.9
    hostname: media
    networks:
      squeezebridge:
        ipv4_address: 192.168.0.96

    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /data/squeeze:/srv/squeezebox
      - /data/share/mp3:/srv/music
    ports:
      - "9000:9000"
      - "9090:9090"
      - "3483:3483"
      - "3483:3483/udp"
    restart: always
    init: true

networks:
  squeezebridge:
    driver: macvlan
    driver_opts:
      parent: eno1
    ipam:
      config:
        - subnet: 192.168.0.0/24
          gateway: 192.168.0.1
          ip_range: 192.168.0.96/32

The host has an ethernet interface eno1, and the subnet and gateway settings are the same as for that interface. The ipv4_address and ip_range settings are the ip address that the LMS server should be assigned. The ip_range needs to be a CIDR value. Strictly speaking I suppose ip range as a /32 isn't required, but i stopped fiddling when it started working!

Thanks for making this nice docker image.

Cheers

James

@larsks
Copy link
Owner

larsks commented Jan 3, 2019

James,

Thanks for the note! That's great information. I think I'll add this to the README.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants