How to run a docker container on a USB drive?

Suppose we have Linux installed on two identical machines that support the latest version of Docker. Then suppose we create a container image based on this OS. We can assume that this image will now work on any machine. Now we put this image on a USB drive and connect it to another identical machine.

Now, the hard part ... is it possible using this image on a USB drive to launch the container on the same USB drive as it is, being connected to the machine?

I am trying to save and / or minimize the memory used by the host operating system using as much memory as possible on a USB drive.

If possible, how can I set up a demo?

+4
source share
1 answer

I view this question as "like persistent docker data on USB."

On your computers, you need to connect your USB to / var / docker. Then restart the docker service.

However, with this solution, when you unplug the USB port, all containers should be stopped. Otherwise, LOSE DATA.

+1
source

All Articles