How Can I Use Docker Containers on an External Drive for Multiple PCs?

0
4
Asked By CuriousCoder42 On

Hey everyone! I'm trying to figure out how to store Docker containers on an external SSD so I can seamlessly move between different Windows PCs. I'm currently working with 2-3 machines at different locations, all running WSL2 and Docker with about 10 containers in total. I've already successfully set up the WSL distribution on the external drive, but I'm struggling to do the same for my Docker containers.

I've tried using symlinks, modifying the daemon.json file to change the data source, and adjusting settings within Docker, but nothing seems to be working. I really want to avoid having to set everything up again every time I switch machines. Maybe I'm not understanding Docker concepts well enough, or maybe it's just not possible. Any advice would be greatly appreciated! Thanks!

2 Answers

Answered By TechieTom100 On

Have you considered running a VM from the external drive instead? I know it might be different, but it could give you more flexibility with Docker. Just a thought!

CuriousCoder42 -

That's interesting! I guess I could look into using something like VirtualBox. But since I’m part of a big project with my team, I'm not sure if I can make big changes on my end.

Answered By WebDevWanda On

I assume your tools are web-based, so why not run your Docker containers on a server? You could then access everything through the web interface. However, if you're looking to have file storage with the containers, I get why you want to keep them on an external drive.

CuriousCoder42 -

Great point! Yes, the project is for web work, but I've realized that my files are in my WSL distribution, while the database is stored in a Docker container. I found a workaround which is to export the database from the last PC and import it on the new one. Not ideal, but it works for now. Still curious if it’s possible to keep the images on the external drive.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.