mounts multiple volume on fly.toml

currently, I only mounts a single volume with this configuration

[mounts]
  source="xxxx"
  destination="/data"

but now I’m trying to mounts another volume in single fly.toml, what I already try is:

[mounts]
  source="xxxx"
  destination="/data"

[mounts]
  source="x1x1"
  destination="/data1"

but It’s gave me an error : “Cannot redefine existing key ‘mounts’.”

thanks

You can only mount one volume to a VM, currently. The section name is misleading :slight_smile:

2 Likes

Are there any plans on supporting multiple volumes mounts in the future. I have a docker container that targets 3 different mount points on the underlying file system and this looks like a blocker.

We’re planning to support multiple mounts sometime, but we’re not actively working on it.

I wouldn’t wait on this, though. It’s likely you can make the Docker container use three different paths on the same volume.

Thanks for the confirmation @kurt. Just expanding on your suggestion of using a single volume, I would have assumed selecting a higher mount point in the desired path would replace any existing file system contents. For example, if I was trying to support multiple directories under the /val root path, the following config would be mounted as an empty /var directory by default?

[mounts]
  source="var_vol"
  destination="/var"

I believe the container in question uses the various mount points for writing runtime state and logs but there is likely to be an entire tree structure of directories under /var in the container build that would be missing in the default volume create and mount.