sbt-docker-compose icon indicating copy to clipboard operation
sbt-docker-compose copied to clipboard

Configurable 'instanceName' (-p project-name)

Open pme123 opened this issue 5 years ago • 0 comments

docker-compose has this option:

-p, --project-name NAME     Specify an alternate project name
                              (default: directory name)

sbt-docker-compose generates a random instance name for this option:

    //Generate random instance name so that it won't collide with other instances running and so that it can be uniquely
    //identified from the list of running containers
    val instanceName = generateInstanceName(state)

I would like to add the possibility to add a configuration to set a static name.

For example:

composeInstanceName := // Specify a docker-compose project-name. By default a random instance name is generated - so that it won't collide with other instances running and so that it can be uniquely

composeInstanceName := "DEV"

This creates images like DEV/postgres_1

pme123 avatar Apr 08 '19 08:04 pme123