Skip to content

3.0 Storage Volumes

Rob Ballantyne edited this page Apr 1, 2024 · 1 revision

Data inside docker containers is ephemeral - You'll lose all of it when the container is destroyed.

You may opt to mount a data volume at /workspace - This is a directory that ai-dock images will look for to make downloaded data available outside of the container for persistence.

This is usually of importance where large files are downloaded at runtime or if you need a space to save your work. This is the ideal location to store any code you are working on.

You can define an alternative path for the workspace directory by passing the environment variable WORKSPACE=/my/alternative/path/ and mounting your volume there. This feature will generally assist where cloud providers enforce their own mountpoint location for persistent storage.

The provided docker-compose.yaml will mount the local directory ./workspace at /workspace.

When the workspace is a mounted volume, the system user account will have its home directory set to $WORKSPACE/home/$USER_NAME. This is to allow persistence of configuration settings with a single volume. This is necessitated by restrictions set by cloud providers.

Clone this wiki locally