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

Allow mount_path to be specified when defining volumes. #540

Closed
wants to merge 1 commit into from

Conversation

TarekkMA
Copy link
Contributor

@TarekkMA TarekkMA commented Mar 21, 2021

The previous implementation of this feature, would result in the host_path and the mount_path to be the same with not option to make a custom mount path.

@Alexhuszagh
Copy link
Contributor

Alexhuszagh commented Jun 9, 2022

Ah I can see why this would be needed. Say I need to include data while compiling from $HOME/.config/mydata, and since the home directory will be different paths for the host and mount, then you want to be able to mount this to the same logical point in the container? The logic has changed significantly in our code, so this will likely need a fresh PR, but I'm not opposed to this on principal.

Say, for example:

fn main() {
    let my_str = include_str!(concat!(env!("HOME"), "/path/to/file"));
    print!("{my_str}");
}

Your source code wouldn't compile unless FILE is set and to the proper path.

However...

I still think there's a better way of doing this? Environment variables aren't shared between the host and container, unless passthrough is used. And I don't think including data at compile time from an environment variable is that good an idea, but I mean it could be required?

@Alexhuszagh
Copy link
Contributor

Actually closing since you can do this via DOCKER_OPTS, and for very esoteric behavior like this that would require much more than "zero" setup, since it is almost certainly host-specific, you can always provide it via another config option, and isn't a valid path which is what we planned to support.

@Alexhuszagh Alexhuszagh closed this Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants