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
Proposal: Allow fig up
(no other arguments) to run a subset of containers
#697
Comments
If I understand this correctly, the only difference would be that you could run |
fig up
(no other arguments) launches a "default" containerfig up
(no other arguments) to run a subset of containers
@dnephin Yup! |
+1 |
Looking for this feature as well. My needs are similar. We have several services that should start on |
This proposal is quite nicely written. I think fig users would definitely benefit from it, and I certainly have a need for this. However, I would personally prefer to see |
+1 |
In the same spirit, could you allow For example it can be usefull to remove all containers except them with data volume. |
I don't think this is a good idea (for both You can already start or rm a subset of containers by using their names:
Having these default to a subset of services makes it less intuitive, and it doesn't give you any extra functionality. This feature would actually remove functionality, since it would make it impossible to perform some action on all containers if you were to specify a subset. |
I think their idea is more like being able to write shorter command lines, being able to |
I'd like to see something like this for I don't want but instead of adding |
Thanks for the suggestion! I've created an issue here to aggregate many similar suggestions: #1896 |
TL;DR
It seems like it would be useful to be able to specify a subset of "default" containers that would be run when using plain old
fig up
.Background
As a concrete example, I have a Rails app that uses Cucumber for feature testing. (The Cucumber tests run as a separate process that makes requests to a running instance of the application.) I would like to have the Cucumber tests containerized along side my application so that my team (and our CI server) can easily run the feature tests.
If I do this, though, then a plain
fig up
has the effect of starting all of my containers (including the Cucumber container), running the feature tests, and then shutting down.A work-around is to use
fig up app
to launch the app (and db, etc), but this just doesn't sit right with me. It seems like anywhere Fig is being used, I should be able to runfig up
and get a running version of the thing.Proposed Solution
What if there were a way to designate one or more containers as the "default" containers? Running
fig up
would then be equivalent to runningfig up <default containers>
. (That is, the default containers and all of their linked containers would be started.)A Strawman
I hesitate to spell out exactly what this setting might look like, because I'm afraid it will cause people to fixate on that aspect. But, it seems like it would be useful for illustration, so here is one way it could be done:
Using this file, running
fig up
would be equivalent tofig up app
. It would start up thedb
,redis
andapp
containers and run until theapp
container exited.Impact Assessment
Obviously, changing the behavior of such a basic command is a Big Deal, and backwards-compatibility is important. Compatibility could be maintained via a "fallback" behavior where if there are no "default" containers, then you just run 'em all like before. That would allow people to opt into this new behavior. The behavior of
fig up xxx yyy
would be unchanged.The text was updated successfully, but these errors were encountered: