Docker - How to import(/de-dupe) from external HDD?

Hi Matt,

I have all my regular folders mounted in the container and it’s all running wonderfully (thank you!), so now I’m turning to my less-regular storage devices and wondering how to include them into my one-photo-folder-to-rule-them-all Photostructure library.

Is there a way to set up my Docker volumes such that I can plug in an external HDD and it’ll get scanned for any photos missing from my main library? Or, could I use the manual import option? I haven’t figured out how to make Docker “see” anything other than the volume/mounting binds (and, obviously, I don’t yet understand the difference between volumes and mounts and which one I’ve done…)


Unfortunately, bind mounts are the typical way to provide access to external host filesystems for docker: avoiding this is one of the biggest “pros” for the node edition versus the docker edition. With the node edition, you plug in a drive, and it gets scanned automatically.

That said, if you use docker-compose, it’s not that painful to docker-compose down, add the additional bind mount, and docker-compose up --detach.

Know also that you can manually run one-off imports of folder hierarchies with sync:

1 Like

I wonder if you could achieve this by mapping a USB port to the container rather than a filesystem. I don’t know if the alpine image has the neccessary software to auto-mount, but that could be remediated.

docker run -t -i --device=/dev/ttyUSB0 ...
1 Like

Thank you both. I like the idea of mapping a port, that’s a really interesting solution.

Am I correct in my assumption that if I plug in a drive/folder that has 90% of the same assets as my PS library, PS will scan the whole thing and import the unique 10%? I’m hoping this is how I’ll make sure my PS library has everything across all my disparate storage sources.

I’ve deployed PS using Portainer rather than docker-compose; am I safe enough just hitting “edit/dulicate”, adding the new volume, then deploying it which automatically stops the old one and starts the new one with the extra volume included?

edit will… duplicate will not.