Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use mount instead of volume in docker compose file to avoid creating empty directories for missing files #473

Open
mmguero opened this issue May 9, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mmguero
Copy link
Collaborator

mmguero commented May 9, 2024

See Differences between -v and --mount behavior:

Because the -v and --volume flags have been a part of Docker for a long time, their behavior cannot be changed. This means that there is one behavior that is different between -v and --mount.

If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory.

If you use --mount to bind-mount a file or directory that does not yet exist on the Docker host, Docker does not automatically create it for you, but generates an error.

Generating an error would be way preferable to creating an empty directory for our bind mounts.

As far as how to do this:

@mmguero mmguero added the enhancement New feature or request label May 9, 2024
@mmguero mmguero assigned mmguero and unassigned mmguero May 9, 2024
@mmguero mmguero modified the milestones: v24.05.0, v24.06.0 May 9, 2024
@mmguero mmguero self-assigned this May 20, 2024
@mmguero
Copy link
Collaborator Author

mmguero commented May 20, 2024

As I have realized this is going to require some changes to install.py where we're adjusting the .yml, I'm going to bump this to a later release to handle it there.

I think the part we really want in the documentation is here: Volumes: Long Syntax

My rough-and-dirty attempt at find-and-replace in my text editor is:

Find: ^( )(-\s*)([^:]+):([^:]+)(:\w+)?$
Replace: $1 - type: bind\n$1 source: $3\n$1 target: $4\n$1 read_only$5\n$1 create_host_path: false

in install.py the calls to ReplaceBindMountLocation are what do this, which is found here. Changing from short form to long form will break this, so we'll have to adjust that when we do it.

@mmguero mmguero modified the milestones: v24.05.0, z.staging May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo (develop)
Development

No branches or pull requests

1 participant