0

I have a docker composition with 3 contaiers. I would like to keep these 3 containers and recreate another instance of the composition, without reusing, nor deleteing the previous 3 containers. Conceptually, would be like running 2 intances of the same application, where the application is the composition.
Docker compose always tries to reuse the existing containers.

Emil Salageanu
  • 997
  • 1
  • 10
  • 24

1 Answers1

3

You can specify a different project for your compose file.

docker-compose -p namespace2 up -d

By default, the project name is the name of the directory where your docker-compose is. You could also create a new dir and copy your compose file into it. It's the same as specifying -p. It basically specifies the namespace for the objects in your compose file.

Bernard
  • 16,149
  • 12
  • 63
  • 66