Server Version#: 1.26.2.5797
Player Version#: 4.81.1
Hello Everyone,
I’m hoping to get some help with a networking issue running Plex Media Server in a Docker container on top of Ubuntu Server 20.04 LTS. I’m using the latest version of Portainer to manage my containers with Stacks (docker-compose). The problem I’m having is assigning a static IP address for the container. I created a macvlan network in Portainers Networks with a range outside of my psfsense routers DHCP range. I’ve put my current working configuration below.
services:
plex:
image: plexinc/pms-docker:plexpass
container_name: plex_docker
network_mode: my_macvlan
mac_address: 02:42:c0:a8:01:c8
environment:
- NVIDIA_VISIBLE_DEVICES=all
- PUID=1000
- PGID=1000
- VERSION=docker
- TZ=America/Chicago
- UMASK_SET=022 #optional
volumes:
- /home/containers/plex:/config
- /media/Video/TV:/tv
- /media/Video/Movies:/movies
- /media/Video/3D:/3D
- /media/Music:/music
restart: unless-stopped
This configuration works perfectly fine except it doesn’t have a static IP. The PMS mac address is set correctly and the IP address is automatically assigned to the first IP in the available range of the macvlan but I want the IP to be static so when I add new containers to the network or have to rebuild this for whatever reason the IP won’t change. Everything I’ve seen so far says to add a static IP the config should look like this:
networks:
my_macvlan:
ipv4_address: 192.168.1.200
However, I can’t get this to work. I get an error saying that the ipv4_address flag is not a regexes. Looking at the plexinc/pms-docker page, it says there is a flag that can be used to set the IP address, --ip=<IPAddress>, when using macvlan networking but I can’t figure out how to convert that to docker-compose.
I would appreciate any help getting this configuration right.
Thanks,