Skip to content

Allow mounting individual files from custom volumes #2230

@defect-track

Description

@defect-track

Is there an existing issue for this?

  • There is no existing issue for this feature

What are you currently unable to do

Since a few releases we can mount a path from a storage volume to a container. This is a great feature not only for OCI but also to place a whole application stack on a single volume.

In some cases you might only want to mount a single configuration file which currently fails. (Error: Failed to start device "testing/test": Unable to mount "/proc/self/fd/40" at "/mnt/tank/incus-data/devices/testing/disk.testing-test.mnt-mytest.txt" with filesystem "none": not a directory)

This is different from what you are allowed to do on host level where you can mount both directories and files.

What do you think would need to be added

Add a similar functionality into the volume path mount like we can do from the host:

  ssh-key:
    path: /home/user/.ssh/keys/ssh_user_ed25519_key
    source: /home/user/sftp/ssh_user_ed25519_key
    type: disk

File path mounting from 'default' pool of 'volume' volume to the same location (suggestion):

  ssh-key:
    path: /home/user/.ssh/keys/ssh_user_ed25519_key
    pool: default
    source: volume/home/user/sftp/ssh_user_ed25519_key
    type: disk

It would be a great addition to allow putting all data for a container on a single volume.

Metadata

Metadata

Assignees

Labels

EasyGood for new contributors

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions