Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stand up select services with docker-compose

I wanted to create a install script which would stand up certain services based on user input. I am using docker for the managing these services. With docker-compose I am able to define multiple services, but by default all the services defined in docker-compose.yml start. Is there any workaround for this ? Also, is this a terrible strategy [but all my services use docker, so is there an alternate way] ?

Thanks!

like image 377
ranafde Avatar asked Jul 18 '16 15:07

ranafde


1 Answers

Do you mean:

docker-compose up SERVICE ?

That should start a single service and any linked containers. You can also do:

docker-compose run SERVICE [COMMAND] [ARGS...]

which might be better for you depending on your needs, has some differences from up in how it's executed. See: https://docs.docker.com/compose/reference/run/

like image 119
ldg Avatar answered Sep 18 '22 19:09

ldg