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

Docker Compose parses host paths for ENV substitution, but not container paths #1626

Closed
objectfox opened this issue Jul 1, 2015 · 4 comments · Fixed by #1633
Closed

Docker Compose parses host paths for ENV substitution, but not container paths #1626

objectfox opened this issue Jul 1, 2015 · 4 comments · Fixed by #1633
Labels
Milestone

Comments

@objectfox
Copy link

This comment in #551 indicates that the following syntax should work for passing SSH_AUTH_SOCK into a container:

volumes:
    - $SSH_AUTH_SOCK:$SSH_AUTH_SOCK
environment:
    - SSH_AUTH_SOCK

However, resolve_host_path in config.py does exactly as it's named, it resolves the host path but not the container path.

This means that the snippet pasted above results in a volume like this:

['/tmp/ssh-4NokVWqj63/agent.10499:$SSH_AUTH_SOCK']

Instead of resolve_host_paths/resolve_host_path, the functions should probably be resolve_path/resolve_paths and resolve both host and container paths.

@objectfox
Copy link
Author

It looks like this is also noted in #1167. There's also #1377, but that seems to be a larger discussion. It seems like a small change, just run container_path through the same parsing as host_path.

@dnephin
Copy link

dnephin commented Jul 3, 2015

I do this by setting the container path to a fixed path. Since it's in a container, there's only going to be one user, so it doesn't really need to be dynamic/random.

volumes:
    - $SSH_AUTH_SOCK:/tmp/agent.sock
environment:
    - SSH_AUTH_SOCK=/tmp/agent.sock

I believe that's what was meant by the referenced comment.

@objectfox
Copy link
Author

Ah ha! I hadn't seen that style before, but it makes sense, since you can volume mount a single file with different names. I'll use this for our current use case, but the commit still might be a handy thing to have.

@aanand
Copy link

aanand commented Jul 3, 2015

Closed by #1633

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

Successfully merging a pull request may close this issue.

3 participants