-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Docker image and bash script for running compose in a container #1806
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does everything work fine if $(pwd) is a subdir of $HOME and we get overlapping volume mounts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, that doesn't seem to be a problem from what I can tell
|
Interesting. Would this make Windows support easier? Paths, TTYs, etc... #1085 |
|
It would run easily enough in cygwin I think, but I don't think windows comes with bash, right? We could re-create this bash script in golang, and publish it as a statically linked binary, which might make it more portable. |
|
Sorry - yes. Assuming we have a similar script or binary running on Windows that runs Compose in a container, would Compose running inside a container work on Windows? |
|
Yes, it would. The other assumption is that volume mounting would 'just work', as it does on OS X (as long as you're within your home directory). |
docs/install.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we added compose-run to the image itself, using docker as the distribution mechanism, and a small install script to echo/output it, e.g.;
# To install the script wrapper, run
$ docker run --rm docker-compose install > /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
# Validate it's working
$ docker-compose --version
docker-compose version: 1.4.0rc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a cool idea, I think that could work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a cool idea. We should probably put an explicit version tag in, so we can change the run script if we need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be a separate image? If you install Compose with the Toolbox, the "install" command might be confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, since this command is really just printing out the bash script, we could probably call it echo-run-script or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The advantage of it being in the same image, is that the image is pulled during "install". The first "run" is instant then :-)
|
@dnephin if you can do a rebase, I'll review. |
|
Rebased |
docs/install.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor edit: Can we make this a link to the alternative install section? Then we can remove the, 'below'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, it seems like there is no standard way to do that with markdown? I guess I have to do something like this https://gohugo.io/extras/crossreferences/ , I'll try it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it out locally, seems to work
52af569 to
8e85709
Compare
docs/install.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest Install as a container as a more descriptive header.
d9bc968 to
1b5a13c
Compare
docs/install.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is missing a $ at the beginning so it'll get rendered as a command.
|
Cool, I've made those changes |
…it with the correct volumes. Signed-off-by: Daniel Nephin <dnephin@gmail.com>
|
LGTM |
|
Come on janky 🐎 🏇 |
Docker image and bash script for running compose in a container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open an issue to get this image published to a better repo, and add notes to the release process doc about updating it on release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use "$PWD" (which will be set by the shell) and avoid the subshells here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would probably work as well. There are times when $PWD isn't set (if you fork/exec without a shell for example).
Does this cause a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No serious problem, just calling out the unnecessary subshell.
Resolves #169
Resolves #1662
The image is ~50Mb.
Thoughts?