[HOW TO] add Shared Folders to an Active Docker Image

Locked
Zarrs
First post
Posts: 1
Joined: Tue Jun 15, 2021 12:47 pm

[HOW TO] add Shared Folders to an Active Docker Image

Post by Zarrs »

Hey Guys,

First of all, im from Germany, sorry for my bad english :)

i´ve been looking around for an Solution on adding Shared Folders to an existing Docker Image...

i was looking how to Add USB-Drives to an Docker image... and i found a Solution on my own =)

you need to edit 3 Files to add Shared folders =) i tested it an its working... stop Container Station on NAS via QBoost disable, then u can open & edit the files (when container station isnt shut down it wont save the data)
u can find these in /container-station-data/lib/docker/containers/<yourcontainerID>/

config.v2.jason , hostconfig.json , qnap.json - these 3 files are the Magical :D

config.v2.jason - look for and add this "SkipMountpointCreation":false},"/sharedfolder":{"Source":"/share/sharedfolder","Destination":"/sharedfolder","RW":true,"Name":"","Driver":"","Type":"bind","Relabel":"rw","Propagation":"rprivate","Spec":{"Type":"bind","Source":"/share/sharedfolder","Target":"/sharedfolder"}, - replace <sharedfolder> with ur folder

hostconfig.json - add: "/share/sharedfolder:/sharedfolder:rw", - replace <sharedfolder> with ur folder

qnap.json - add:"/share/sharedfolder": {"bind": "sharedfolder", "ro": false}, - replace <sharedfolder> with ur folder

thats all... restart container station and have fun with ur added drives to an existing docker image....

Feel Free to Spread this and maybe rewrite this so that other may understand it better?!?!? =)

Have a nice day !!
Do i have to say that i am a Total Linux Noob??? XD
carlson23
New here
Posts: 2
Joined: Thu Aug 30, 2018 2:47 am

Re: Adding Shared Folders to an Active Docker Image - Solution!!!

Post by carlson23 »

How did you edit the files?
Axel.F
New here
Posts: 4
Joined: Wed Mar 13, 2019 5:59 am

Re: Adding Shared Folders to an Active Docker Image - Solution!!!

Post by Axel.F »

I want to add a couple more options you have:

You can create an application (instead of having the container station configure the image). In that case, you basically create a docker compose file in the web editor. When you would like to change anything, just click the edit link...
Alternatively you can use portainer to manage your containers. You will have a nice web interface in which you can deploy containers or composed containers (stacks). Same here - editing be clicking the edit button...

In both cases, if you want to use bind mounts (ie. mount a local NAS folder into your container), you will need to know the correct path (unix command line...) to that folder. Something like "/share/Containers/ApplicationData/KodiDB".
fockyou
Starting out
Posts: 10
Joined: Sun May 29, 2022 11:54 am

Re: Adding Shared Folders to an Active Docker Image - Solution!!!

Post by fockyou »

Thanks a lot, i've done it before but didn't restart it well. Of course I need to edit shared folder over and over. Editing JSONs is ugly but works.
i hate the docker annoyance since it was introduced, the CLI forcage, the cryptics folders, slow and utterly annoying administration. It's unsuitable and not even ment for popular usage, but by some mistake it became an app vehicle. One of the most confusing apps i've ever seen is Portainer. Gladly I can avoid that as ContainerStation is just fine. Unlike DSM, it shows the cryptic folders, no need to suffer the CLI massacre and it even lets you set a beautiful config path "radarr". The terror of searching for configs is gone. The horror of isolating the few configs from a huge amount of files in order to backup got easier. Also this QTS app will let you edit and restart in one step. The main thing missing is editing shared folders, that was a shocking revelation.
Now that QTS does not place the docker apps into the UI menu (unlike DSM), you can put them there by adding the records to qpkg.conf.
Locked

Return to “Container Station”