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

Is it possible to assign a volume name using an environment variable? #449

Closed
andres-root opened this issue Aug 27, 2014 · 2 comments · Fixed by #442
Closed

Is it possible to assign a volume name using an environment variable? #449

andres-root opened this issue Aug 27, 2014 · 2 comments · Fixed by #442

Comments

@andres-root
Copy link

I'm trying to create a volume using an environment variable I previously set up in my Dockerfile. However when I ran the project, fig created a folder with the name of my environment variable, instead of assign its value. I put the code below:

web:
build: .
volumes:
- ${WORKSPACES_HOME}/logs:/webapp/myapp/logs/

I used to do it in docker with the next sintax:
docker run -v ${WORKSPACES_HOME}/logs:/webapp/myapp/logs

@dnephin
Copy link

dnephin commented Aug 27, 2014

The "docker" way is actually bash taking care of the substitution, not docker.

I don't think this is possible yet, but I think it could be with https://docs.python.org/2/library/os.path.html#os.path.expandvars

I can probably add it to #442

dnephin added a commit to dnephin/compose that referenced this issue Aug 28, 2014
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
dnephin added a commit to dnephin/compose that referenced this issue Aug 31, 2014
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@szuliq
Copy link

szuliq commented Mar 5, 2015

This is great and should be documented as part of https://docs.docker.com/compose/yml/#volumes

yuval-k pushed a commit to yuval-k/compose that referenced this issue Apr 10, 2015
Adds ~ support and ro mode support for volumes, along with some additional validation.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants