When spinning up a Compose service using the --scale option, how to add additional instances without interrupting running ones

Viewed 26

I've spin up N instance of an app service using a Compose file.

Let's N=4:

$ docker-compose up --detach --scale app=4 app

Now I'd like to run more of them, as if I had started them all at once.

Let's say I want to start 6 more instances on-the-fly, so that I end up having 10 instances running, as if I launched this command at the very first place:

$ docker-compose up --detach --scale app=10 app

How could I achieve that?

I tested launching 6 mores this way:

$ docker-compose up --detach --scale app=6 app

But this seems to recreate the former, interrupting what they were working on.

0 Answers
Related