Skip to content

Docker image and bash script for running compose in a container#1806

Merged
mnowster merged 1 commit into
docker:masterfrom
dnephin:run_script
Oct 2, 2015
Merged

Docker image and bash script for running compose in a container#1806
mnowster merged 1 commit into
docker:masterfrom
dnephin:run_script

Conversation

@dnephin

@dnephin dnephin commented Aug 3, 2015

Copy link
Copy Markdown

Resolves #169
Resolves #1662

The image is ~50Mb.

Thoughts?

Comment thread script/run

Copy link
Copy Markdown

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?

Copy link
Copy Markdown
Author

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

@bfirsh

bfirsh commented Aug 5, 2015

Copy link
Copy Markdown

Interesting.

Would this make Windows support easier? Paths, TTYs, etc... #1085

@dnephin

dnephin commented Aug 5, 2015

Copy link
Copy Markdown
Author

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.

@bfirsh

bfirsh commented Aug 5, 2015

Copy link
Copy Markdown

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?

@aanand

aanand commented Aug 5, 2015

Copy link
Copy Markdown

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).

Comment thread docs/install.md Outdated

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown

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.

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Author

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?

Copy link
Copy Markdown
Member

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 :-)

@mnowster

mnowster commented Oct 2, 2015

Copy link
Copy Markdown

@dnephin if you can do a rebase, I'll review.

@dnephin

dnephin commented Oct 2, 2015

Copy link
Copy Markdown
Author

Rebased

Comment thread docs/install.md Outdated

Copy link
Copy Markdown

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'.

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Author

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

@dnephin
dnephin force-pushed the run_script branch 2 times, most recently from 52af569 to 8e85709 Compare October 2, 2015 15:31
Comment thread docs/install.md Outdated

Copy link
Copy Markdown

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.

@dnephin
dnephin force-pushed the run_script branch 2 times, most recently from d9bc968 to 1b5a13c Compare October 2, 2015 15:34
Comment thread docs/install.md Outdated

Copy link
Copy Markdown

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.

@dnephin

dnephin commented Oct 2, 2015

Copy link
Copy Markdown
Author

Cool, I've made those changes

…it with the

correct volumes.

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

mnowster commented Oct 2, 2015

Copy link
Copy Markdown

LGTM

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.

7 participants