Docker Community Forums

Share and learn in the Docker community.

Volumes, sources, targets - how to?


#1

Hi

I would like to install plex. I still have trouble understanding the whole architecture behind the scenes: on “use Volume”-Page it ist statet that:

-v or --volume : Consists of three fields, separated by colon characters ( : ). The fields must be in the correct order, and the meaning of each field is not immediately obvious.

  • In the case of named volumes, the first field is the name of the volume, and is unique on a given host machine. For anonymous volumes, the first field is omitted.
  • The second field is the path where the file or directory are mounted in the container.

In the docker-plex they use -v to map eg. path/to/tvseries , which is a folder on my host system and not a volume according to the description… which is now “true”?

If the syntax in the plex-docker version correct - which I think it is: is /path/to/library:/config then just a symlink and all data changing in the /config (which is the folder in the container if I got that one correct) by interaction with plex is actually stored in /path/to/library?

Thank you for clarifying things


#2

The syntax of the plex documentation is one of the possible ways.

Symlinks that point to a location outside the mounted host path will not work.
Instead you need to declare several volumes: one read/write folume for your config and at least one or more for read only volumes for your media library.

Any reason that you didn’t post this in the plex forum? They have a docker subforum.


#3

Hi memay

Thanks, I know the thread you mentioned. My question arose because I don’t understand how docker volumes work exactly. I just found plex is a good example of another way to use -v. My follow up questions:

Does that mean that in this case plex would read the existing library from my path/to/Library and all future changes to that Library would then go into the /config?

My library acutally contains for example the preferences.xml which needs to go in /config. I also have an existing influxdb which I need to bring onto/into a volume so that docker-influxdb continues writing in the existing database instead of startng a new one. In general: how can this be realized? Same question the other way round - how do I get data out of a volume for “clear text” Backups?

One more question: I know I can create named volumes which I did e.g. “plex”. What would be the syntax with -v when I want to map path/to/tvseries to /data/tvseries but on the volume plex (which I have created on my fstab-mounted drive so that there is unlimited space for the volume)?

As you see, there are several gaps in my knowledge/understanding of docker… Could you help me filling them?

Thanks


#4

First of all a mounted volume is not any different as using mount --bind on you linux host.
Your library (as in metadata) needs to be on the host and is just mountend into the containers /config directory.Thus, the data remains external to the container, but is acessible from inside the container.

I don’t use docker-influxdb, and i have no idea about what is required there.

In you scenario, i wouldn’t bother using named volumes. Stay with the -v mounts.


#5

Thanks I gonna post how it went as soon as I find a time-slot to implement it.