kjake
Dabbler
- Joined
- Mar 17, 2017
- Messages
- 29
FN10 Docker convert here - jumping into iocage because warden is going away. I liked the Plex container in FN10 because it would pull the latest release when you restarted the container. I haven't gotten there yet (because I'm writing these for all of my old containers), but this is better than relying on the TrueOS people to provide an updated package.
This was written from the perspective of an existing installation and to keep the config files outside of the jail so that it can be rebuilt whenever. Not tested as a fresh install.
I will come back to this one and work on getting it to be the latest build of plex.
This was written from the perspective of an existing installation and to keep the config files outside of the jail so that it can be rebuilt whenever. Not tested as a fresh install.
I will come back to this one and work on getting it to be the latest build of plex.
Code:
#!/bin/sh # stop the jail nicely iocage stop plex # delete the jail iocage destroy -f plex # make temp file that will cause iocage to install some packages echo '{"pkgs":["compat9x-amd64"]}' > /tmp/pkg.json # create jail iocage create --name "plex" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|[PLEX_IP]/24" vnet="on" allow_raw_sockets="1" defaultrouter="[GATEWAY_IP]" boot="on" host_hostname="plex" # remove the temp file rm /tmp/pkg.json # map common portsnap storage outside of jail iocage fstab -a plex /mnt/[zpool_not_iocage]/portsnap/ports /usr/ports nullfs rw 0 0 iocage fstab -a plex /mnt/[zpool_not_iocage]/portsnap/db /var/db/portsnap nullfs rw 0 0 # update ports as needed iocage exec plex "if [ -z /usr/ports ]; then portsnap fetch extract; else portsnap auto; fi" # install plex and clean up iocage exec plex make -C /usr/ports/multimedia/plexmediaserver-plexpass install clean BATCH=yes # map media and plex confg outside of jail iocage fstab -a plex /mnt/[zpool_not_iocage]/path/to/videos /videos nullfs rw 0 0 iocage fstab -a plex /mnt/[zpool_not_iocage]/plex/Transcode /transcode nullfs rw 0 0 iocage fstab -a plex /mnt/[zpool_not_iocage]/plex/Library /config nullfs rw 0 0 # change ownership on plex files to the new plex user, but this could take a long time so not doing it by default # iocage exec plex chown -R plex /config # configure plex to use our mapped path instead of default iocage exec plex sysrc -f /etc/rc.conf plexmediaserver_plexpass_support_path="/config/Application Support" # make sure plex is enabled to run on startup iocage exec plex sysrc -f /etc/rc.conf plexmediaserver_plexpass_enable="YES" # restart the jail iocage restart plex
Last edited: