Code Monkey home page Code Monkey logo

docker-plex-remote-transcoder's Introduction

Docker containers for Plex Media Server with Remote Transcoding Support

Using the Official Plex docker container as a base, with remote transcoding support provided by Plex Remote Transcoder we pair the two together using Docker.

The Official Plex docker image is the basis for both the master and slave, so their documentation also applies to these containers. Given that, I won't repeat that information here.

Prerequisites

  • Docker

Usage

Master

docker run \
--name plex \
-p 32400:32400/tcp \
-p 3005:3005/tcp \
-p 8324:8324/tcp \
-p 32469:32469/tcp \
-p 1900:1900/udp \
-p 32410:32410/udp \
-p 32412:32412/udp \
-p 32413:32413/udp \
-p 32414:32414/udp \
-e TZ="<timezone>" \
-e PLEX_CLAIM="<claimToken>" \
-e ADVERTISE_IP="http://<hostIPAddress>:32400/" \
-e MASTER_IP="<hostIPAddress>" \
-e PLEX_UID="<plexUid>" \
-e PLEX_GID="<plexGid>" \
-v <path/to/plex/database>:/config \
-v <path/to/transcode/temp>:/transcode \
-v <path/to/tv/series>:/data/tvshows \
-v <path/to/movies>:/data/movies \
-v <path/to/another/media>:/data/mediaTypeA \
-v <path/to/some/other/media>:/data/mediaTypeB \
deevus/plex-remote-transcoder:master-latest

Slave

docker run \
--name plex-slave \
-p 22:22 \
-e TZ="<timezone>" \
-e MASTER_IP="<hostIPAddress>" \
-e SLAVE_IP="<slaveIPAddress>" \
-e SLAVE_PORT="<slavePort>" \
-e SLAVE_USER="<slaveUser>" \
-e PLEX_UID="<plexUid>" \
-e PLEX_GID="<plexGid>" \
-v <path/to/plex/database>:/config \
-v <path/to/transcode/temp>:/transcode \
-v <path/to/tv/series>:/data/tvshows \
-v <path/to/movies>:/data/movies \
-v <path/to/another/media>:/data/mediaTypeA \
-v <path/to/some/other/media>:/data/mediaTypeB \
deevus/plex-remote-transcoder:slave-latest

NB. The volume paths inside the containers need to match! If they don't, it won't work.

Parameters

  • For explanation of the base image parameters see their documentation.
    • Pay particular attention to PLEX_UID and PLEX_GID as this can affect the slaves ability to transcode.

Master & Slave

  • -e MASTER_IP="<hostIPAddress>" this is the externally visible ip address (or hostname) for the Plex master.

Master

  • -e SLAVE_IP="<slaveIPAddress>" this is the IP address (or hostname) of the Plex slave.
  • -e SLAVE_PORT="<slavePort>" this is the SSH port of the Plex slave (default = 22).
  • -e SLAVE_USER="<slaveUser>" this is the SSH user of the Plex slave (default = plex).

Configuration

Getting up and running is very similar to the official image. If the slave is off, unreachable or not configured, the master server will function exactly as the official Plex Media Server container. This means that you can start-up, or shut-down the slave(s) as needed.

When you start up the master for the first time, it will add the slave as per the given parameters. The .prt.conf will be available in the mounted /config directory so you can change it from your host if need be.

At this stage you need to go into the master container and ssh to the slave. The reasons for which are outlined vaguely here.

# connect to an interactive terminal in the master container
docker exec -ti plex bash
# ssh to the slave so that we can type "yes" and populate `known_hosts`
ssh <slaveUser>@<slaveIPAddress> -p <slavePort>

If all goes well (and you typed "yes") you should be connected to the slave via ssh.

How do I mount my volumes on my master server to my slave?

  • NFS
  • CIFS
  • Anything you like

Docker on Windows?

Not officially. Docker on Windows only allows you to mount local volumes that you have explicitly allowed in settings. This means mounting network volumes is out of the question.

...

However, I have created an auxiliary slave image that can be used to mount NFS shares inside the container. If you want a master image that can do the same thing, you'll have to ask nicely, but I didn't need it, so I didn't do it.

Docker on Mac?

Dunno, haven't tried it. The above solution for Windows might work. Let me know.

docker-plex-remote-transcoder's People

Contributors

deevus avatar oaxlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-plex-remote-transcoder's Issues

Slave shows ups on check config and get cluster load, but no transcode

Any Ideas? For all a can tell the slave is there. I had to fiddle with the ssh keys to get them usable, but the master logs in no password with the plex user via ssh.

But any time I run a transcode, it’s handled by the master.

Could it be that the containers are not running as plex user?

Feature request: NFS server built into master image

Any chance this could be added, so that the master image's local transcode volume could be served out to the docker-plex-remote-transcoder-nfs slave image? Would be super useful as a fully self-contained solution. In the event you're able to add this, thank you in advance!

automatically mount volumes inside the cointainers

This is idea to simplify all the steps

Using glusterFS or NFS internally in the plex main server you can avoid to manually create the NFS/SMB server, so user only need to run the both dockers and forget(maybe he will need to open some ports)
To simplify the port things and for security user should use docker swarm overlay network or rancher IPSEC network/VXLAN or weave network.
So slave transcoders can connect directly to the container IP.

Error when pulling docker image

Not sure if this is the right place for this or not, but when I try to pull this docker image, I get this error: traveler:~ austin$ docker pull deevus/plex-remote-transcoder
Using default tag: latest
Error response from daemon: manifest for deevus/plex-remote-transcoder:latest not found

I got the pull command straight from https://hub.docker.com/r/deevus/plex-remote-transcoder.

Am I missing something? Thanks!

cannot start slave... timeout

Slave fails to start, getting a connection timed out error with no further information...

/usr/bin/docker-current: Error response from daemon: connection timed out.

using `docker run \

--name plex_slave
--restart=always
--network=host
-e TZ="Americas/Los_Angeles"
-e MASTER_IP="192.168.0.25"
-e SLAVE_IP="192.168.0.60"
-e SLAVE_PORT="22"
-e SLAVE_USER="plex"
-e PLEX_UID="1010"
-e PLEX_GID="1001"
-v /mnt/configs/plex/config:/config
-v /mnt/configs/plex/transcode/tmp:/transcode
-v nfs_completed_Movies:/data/movies
-v nfs_completed_TV:/data/tvshows
deevus/plex-remote-transcoder:slave-latest`

issues with bridged mode docker

this is definitely more of a documentation request. could you please clarify the steps required to get ssh between the master and the slave working within a bridged network configuration? also, when using a bridged network for the master, remote access is not available from outside the network (presumably due to double NAT issues)... current documentation is lacking clear details on these two items for the default docker configuration

Can't connect to slave

Here is what I am using for Master

sudo docker run \
--name plex \
--network=host \
-e TZ=America/Indiana/Indianapolis \
-e ADVERTISE_IP="http://10.10.1.38:32400/" \
-e MASTER_IP="10.10.1.38" \
-e PLEX_UID="1002" \
-e PLEX_GID="1002" \
-e SLAVE_IP="10.10.1.20" \
-e SLAVE_PORT="2222" \
-e SLAVE_USER="plex" \
-v /mnt/plex/config:/config \
-v /mnt/plex/transcode:/transcode \
-v /mnt/tv/:/data/tvshows \
-v /mnt/movies/Movies:/data/movies \
deevus/plex-remote-transcoder:master-latest

Here is what I am using for Slave

sudo docker run \
--name plex-slave \
-p 2222:22 \
-e TZ=America/Indiana/Indianapolis \
-e MASTER_IP="10.10.1.38" \
-e PLEX_UID="1002" \
-e PLEX_GID="1002" \
-v /mnt/plex/config:/config \
-v /mnt/plex/transcode:/transcode \
-v /mnt/tv/:/data/tvshows \
-v /mnt/movies/Movies:/data/movies \
deevus/plex-remote-transcoder:slave-latest

Here is the master output I get:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 40-plex-first-run: executing...
Creating pref shell
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 50-plex-update: executing...
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] 61-prt-master-install: executing...
Installing Plex Remote Transcoder
IP address of this machine: Renaming original transcoder
[cont-init.d] 61-prt-master-install: exited 0.
[cont-init.d] 62-prt-add-slaves: executing...
Host: Port: User: We're going to add the following transcode host:
  Host: 10.10.1.20
  Port: 2222
  User: plex
Proceed: [y/n]Host successfully added
[cont-init.d] 62-prt-add-slaves: exited 0.
[cont-init.d] 62-ssh-keygen: executing...
Generating public/private rsa key pair.
Your identification has been saved in /config/.ssh/id_rsa.
Your public key has been saved in /config/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:wBMFfm7qdBoLHMMFKUmGuF7XRi7XRl/TNWTftVPHnIU root@pet-minnow
The key's randomart image is:
+---[RSA 2048]----+
|.oo...oo.     oBX|
|o.o .+ o .   oEo@|
| . .  X + . . .oo|
|.  o + X o .    .|
|. . = + S        |
| . . o o         |
|    o + .        |
|     + =         |
|      +          |
+----[SHA256]-----+
[cont-init.d] 62-ssh-keygen: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting Plex Media Server.

Here is what I get on slave:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-ssh-init: executing...
INFO: importing public key
cat: /config/.ssh/id_rsa.pub: Permission denied
[cont-init.d] 10-ssh-init: exited 1.
[cont-init.d] 40-plex-first-run: executing...
chown: changing ownership of '/transcode/Transcode/Sessions': Operation not permitted
chown: changing ownership of '/transcode/Transcode': Operation not permitted
chown: changing ownership of '/transcode': Operation not permitted
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 50-plex-update: executing...
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
Permission denied: /config/Library/Application Support/Plex Media Server/Preferences.xml
failed to load external entity "/config/Library/Application Support/Plex Media Server/Preferences.xml"
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] 60-prt-install: executing...
Installing Plex Remote Transcoder
IP address of this machine: Error loading config: [Errno 13] Permission denied: '/config/.prt.conf'
Renaming original transcoder
[cont-init.d] 60-prt-install: exited 0.
[cont-init.d] 61-prt-register: executing...
Host: Port: Traceback (most recent call last):
  File "/usr/local/bin/prt", line 9, in <module>
    load_entry_point('prt==0.4.4', 'console_scripts', 'prt')()
  File "/usr/local/lib/python2.7/dist-packages/prt-0.4.4-py2.7.egg/prt.py", line 680, in main
EOFError: EOF when reading a line
[cont-init.d] 61-prt-register: exited 1.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

I went in and change file permission on config to add read for everyone.
Then my slave output looks like this:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-ssh-init: executing...
INFO: importing public key
[cont-init.d] 10-ssh-init: exited 0.
[cont-init.d] 40-plex-first-run: executing...
chown: changing ownership of '/transcode/Transcode/Sessions': Operation not permitted
chown: changing ownership of '/transcode/Transcode': Operation not permitted
chown: changing ownership of '/transcode': Operation not permitted
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 50-plex-update: executing...
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] 60-prt-install: executing...
Installing Plex Remote Transcoder
IP address of this machine: Error loading config: [Errno 13] Permission denied: '/config/.prt.conf'
Renaming original transcoder
[cont-init.d] 60-prt-install: exited 0.
[cont-init.d] 61-prt-register: executing...
Traceback (most recent call last):
  File "/usr/local/bin/prt", line 9, in <module>
    load_entry_point('prt==0.4.4', 'console_scripts', 'prt')()
  File "/usr/local/lib/python2.7/dist-packages/prt-0.4.4-py2.7.egg/prt.py", line 680, in main
Host: Port: EOFError: EOF when reading a line
[cont-init.d] 61-prt-register: exited 1.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

I have /config set as NFS share with (rw,sync,no_subtree_check)

Is there something I'm missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.