Skip to content

Manage Shared Container Data

There are different ways to mount data into a container:

  • tmpfs mount
  • anonymous volumes
  • named volumes
  • bind mount

tmpfs mounts

tmpfs:
  - /run
  - /tmp
  • A tmpfs mount gives the container access to the data without writing it anywhere permanently.

  • When the container is stopped the tmpfs mount is removed.

  • tmpfs mounts cannot be shared among containers.

Volumes

volumes:
  ## Just specify a path and let Exenia create an anonymous volume
  - /var/lib/mysql

  ## Named volume
  - datavolume:/var/lib/mysql
  • Volumes are for persisting data generated by and used by containers.

  • When a volume is first used, the directory’s contents will be copied into the volume.

  • When the container is stopped the volume is not removed.

  • Named volumes can be shared among multiple indapps and containers.

Bind mounts

volumes:
  ## Specify an absolute path mapping
  - /opt/data:/var/lib/mysql
  • A file or directory on the host machine is mounted into a container.

  • They rely on the host machine’s filesystem having a specific directory structure.

  • The directory’s existing contents will be obscured by the bind mount.

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the The Siemens Inner Source License - 1.1.