-
Notifications
You must be signed in to change notification settings - Fork 101
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
Start detached container #53
Comments
Thanks for the suggestion! What's the advantage of this method over using existing tools like |
That I wouldn't have to install MongoDB and could have it run in a container instead of on my local machine. I would develop my apps locally against this MongoDB and as soon as I'm done, just stop and remove the container. I'm already doing this already but currently I start the container with |
Inception! Maybe simply run it in bg then?
|
My goal is not to be able to run something in the background... |
No, I meant the idea of whalebrew is to treat docker containers as native commands. The naive way to run native commands in bg is & :) Maybe whalebrew should have |
Thanks for your feedback, @themalkolm! Since we already have some docker args covered through the labels that you can give your image (e.g. |
So if we do make whalebrew to run a detached command, how do you then kill/stop that container? |
Yep, this is the problem with detached containers I see. Now you suddenly break out of this abstraction and need to know that it is actually a docker container. |
good point... you would really need to run |
This is why I suggested to simply run this cmd in bg so whenever it is killed it will stop the container automatically. But I think this is so error prone to random containers floating around. |
Yup, it's a leaky abstraction, but I think commands by default always running in the background is even worse, because you have no idea it is running in the background, as @themalkolm says. To solve that I suppose if it starts something in detached mode, it could say something like "Starting mongo in the background. Use Docker commands to manage it." If you run |
I can image there would also be advantages to being able to use the docker DNS'ing to connect to whalebrew'd containers using container names. |
Effectively isn't the ideal to be able to have your brew services running inside docker containers? So e.g. my local redis, postgres, mongo, elasticsearch etc can all be running off cleanly separated docker containers? |
I would like to create a whalebrew package for
mongod
which starts MongoDB as a daemon. I think it would be awesome if I could just runmongodb
and whalebrew would start my MongoDB in a detached Docker container. As far as I can tell, all we need for that is a Docker image calledwhalebrew/mongod
from the followingDockerfile
:And a new config label for whalebrew called
io.whalebrew.config.detach
which would set the-d
flag when running the container. What do you guys think?The text was updated successfully, but these errors were encountered: