Access dockerized service from another dockerized service?


Recommended Posts

I have the official Plex docker container installed and I'm using the Live TV and DVR functionality.  It's working great, but I'd like to be able use the post processing script functionality to encode the over the air recordings into something smaller and more compatible with my devices (h.264, MKV).  I need to link a script that will run ffmpeg or handbrake-cli.

 

I can install an ffmpeg docker container, but I'm not sure how to communicate between the two.

 

My thinking is that I put the script somewhere accessible by both docker containers (somewhere like /boot/config/plugins/scripts) and then mount that directory in both the Plex Media server and the ffmpeg docker to something like /scripts/.

 

From there, in Plex Media Server, I would call the script with /scripts/myscript.sh, and then in the script itself I would use some sort of docker command to call ffmpeg within the docker container? 

 

For instance:  

docker run dockerhubRepo/ffmpeg -i localfile.mp4 out.webm

 

Am I on the right path here, or am I way off?  My first thought was to just install ffmpeg onto the PMS docker container, but my understanding of docker containers is that when updated, they are completely wiped and reinstalled, which is why all the configs are saved in /appdata/ because that isn't touched when the image gets nuked.

 

Obviously the script would be more complicated than that, but you get the idea.

 

Any help would be appreciated.

 

 

EDIT:  OK, I figured it out.  I've been testing it and I am getting an error 127 (key expired) on my Plex server.  In testing I've learned that one cannot pass spaces through the docker container, which is a problem because of Plex's naming convention.  There is no way for me not to have spaces or uppercase letters in my folder structures...

 

I guess I'm back to square one here.  I really wish I could just install ffmpeg directly onto the unRAID server.

 

FINAL EDIT:

 

I solved this by creating my own docker container.  It's just the official plexinc/pms-docker image with ffmpeg installed as well.

 

This is an automated build which is linked directly to the plexinc/pms-docker image, so you won't be reliant on me to update the container as an update will be triggered automatically when the official plex docker is update.

 

https://hub.docker.com/r/herdo/plexffmpeg/

Edited by Herdo
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.