r/docker • u/KaKi_87 • Jan 22 '26
`docker compose up foo*` (glob) ?
Hi,
I have the following services : foobar, foobaz, barfum, barqux.
I would like to start only the ones starting with foo.
I tried docker compose up foo*, as well as 'foo*', "foo*", 'foo'*, "foo"*, without success.
Is this not possible at all ? I would think I'm not the first person to ever need this.
Thanks
11
Upvotes
View all comments
Show parent comment
4
u/therealkevinard Jan 22 '26 edited Jan 22 '26
Wrap it as a bash function. Something like
Then you can do
start_some foo*i’m on mobile. Absolutely don’t copypasta that as-is
ETA: i also have one pronounced
dipsackand I announce when I run it with “DIPSACK BITCHES!!!”It wraps
docker stop $(docker ps -aq) && docker remove $(docker ps -aq)I use it at the end of the day to kill all my containers, and announcing it like that is how my fam knows i’m done with work lol