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 containers that don't need to stay running #1476

Closed
ndarilek opened this issue May 29, 2015 · 3 comments
Closed

Support containers that don't need to stay running #1476

ndarilek opened this issue May 29, 2015 · 3 comments

Comments

@ndarilek
Copy link

Apologies if this is already supported and I don't see it.

Say you're building an app with a static HTML UI and a web server. During development you may use volumes and automatic rebuilds, but in production, maybe you only wish to run the static HTML container and have it dump output in a directory reachable by the HTML server container. It may be possible to start the container separately and just use Compose for the web server, but having the entire bootstrap process in docker-compose.yml would be nice.

Or say you have an app and a sidekick container that registers details in etcd. The sidekick doesn't need to continue running once the app is launched. It just needs to run after the app container launches to register necessary details.

It'd be nice if I could mark containers as not needing to continue running when Compose brings the stack up. Maybe as long as the exit code is 0, the launch is considered successful. Or maybe the exit code can be definable, something like success_on_exit: 0. If it isn't defined, the container must keep running as per usual. Otherwise, exiting with the specified code is deemed a success and the docker-compose up doesn't exit. So you'd have something like:

html:
image: someone/jekyll
success_on_exit: 0

This runs Jekyll on docker-compose up. If the return code is 0, html is considered to have finished successfully, and the other processes run as normal. html can be launched again to rebuild the static HTML, or run with a different cmd to rebuild on change in development.

@aanand
Copy link

aanand commented May 29, 2015

I think the best solution is to stop docker-compose up from exiting when a single container exits. Some discussion of that, and related issues, here: #741

@ndarilek
Copy link
Author

ndarilek commented May 29, 2015 via email

@dnephin
Copy link

dnephin commented Aug 8, 2015

Fixed by #1754 will be in 1.5

@dnephin dnephin closed this as completed Aug 8, 2015
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

No branches or pull requests

3 participants