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

Support environment variables in volume names #76

Open
danielmai opened this issue Nov 15, 2018 · 2 comments
Open

Support environment variables in volume names #76

danielmai opened this issue Nov 15, 2018 · 2 comments

Comments

@danielmai
Copy link

danielmai commented Nov 15, 2018

For the volumes configuration I want to use shell environment variables within the config string when specifying the directory paths to mount.

I want to be able to do this:

volumes:
  "$GOPATH/bin": "/gobin"

This should pick up the environment variable $GOPATH and use that for bind-mounting the directory to the container. That's how it works in a Docker Compose file.

Instead, in blockade, not only does it not recognize and expand the environment variable, it also creates a directory called $GOPATH and a subdirectory $GOPATH/bin in the current working directory.

@danielmai
Copy link
Author

danielmai commented Nov 15, 2018

Ah, I just noticed that blockade does support environment variables.

https://github.com/worstcase/blockade/blob/master/blockade/config.py#L190

But it only accepts it with curly braces. ${GOPATH} works, but not $GOPATH. At least I can get it working now.

@labisso
Copy link
Member

labisso commented Nov 17, 2018

Yeah that is a good point, the env variable parsing is quite basic. I think it was a quick hack thrown in, but that'd be a good thing to improve. I'll keep this open as a reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants