Docker - Data Persistence

Card Puncher Data Processing


mount a file or directory of the host into a container.

Bind mounts and volumes can both mounted into containers using the -v or –volume flag.

From your machine to the container

If you want to have the files of your machine on the host, you need to mount them on the host. See Shared drive configuration on Virtual Box

You can also use:

  • the cp command to transfer file between your local file system and the container
  • from the host: vim scp:remoteuser@containerippath/to/document

Bind Mount vs Volume

Bind mounts have limited functionality compared to volume. By contrast, when you use a volume, a new directory is created within Docker’s storage directory on the host machine, and Docker manages that directory’s contents.

Discover More
Docker Shared Drive New Credentials
Docker - Bind mount

bind mount is type of mount. It's one of the three way on how you can persist data from a container. See The file or directory is referenced by its full or relative path on the host machine. The...
Card Puncher Data Processing
Docker - Volume Mount

in Docker. A volume is one type of mount in docker. Volumes are one of the way of persisting data between container execution. They are file store on the host where you can persist data generated by...

Share this page:
Follow us:
Task Runner