Skip to content

dmp:stop 0.46 does not remove the container; dmp:start doesn't find a new name by pattern. #1867

@OndraZizka

Description

@OndraZizka

DMP is great! Better than dockerfiles for sure.

Although, I have two issues in one:

I have a project which stops a container, then starts it, then stops it.

The stop at the beginning is there to take care of containers left running because of a build error etc.
The start and stop share the same <run> config.

                    <allContainers>true</allContainers>
                    <containerNamePattern>%n-for-jooq-%i</containerNamePattern>
...
                <executions>
                    <execution><id>runGranit--startCrdb</id><phase>initialize</phase><goals><goal>stop</goal><goal>remove</goal><goal>start</goal></goals></execution>
                    <execution><id>runGranit--stopCrdb</id><phase>process-sources</phase><goals><goal>stop</goal></goals>
                        <!-- Otherwise, there's some race condition - "Removal in progress, code 409". -->
                        <configuration><executeStopOnVMShutdown>true</executeStopOnVMShutdown></configuration>
                    </execution>
                </executions>

Otherwise nothing special. stopMode is the default (graceful).

However, DMP does not really stop AND remove the container. See:

[INFO] --- docker:0.46.0:stop (runGranit--startCrdb) @ config-hub-jooq-models ---
[INFO] 
[INFO] --- docker:0.46.0:remove (runGranit--startCrdb) @ config-hub-jooq-models ---
[INFO] 
[INFO] --- docker:0.46.0:start (runGranit--startCrdb) @ config-hub-jooq-models ---

[ERROR] DOCKER> Error occurred during container startup, shutting down...
[ERROR] DOCKER> I/O Error [Unable to create container for [com.acme.confighub/config-hub-granit-schemas:1.0.0-SNAPSHOT] : 
{"message":"Conflict. The container name \"/config-hub-granit-schemas-for-jooq-1\" is already in use by container \"9922e7e80d1690e6f66ead0c014083cfaec0d1b7dda3a9b87b696badc4df47a1\". 
You have to remove (or rename) that container to be able to reuse that name."} (Conflict: 409)]

After that, though, docker container ls -a shows that there's an old container not being removed:

docker container ls -a
CONTAINER ID   IMAGE  COMMAND                  CREATED       STATUS                     PORTS                                                                                        NAMES
9922e7e80d16   7c68f8cb0965  "/cockroach/cockroac…"   13 days ago   Exited (255) 11 days ago   0.0.0.0:32824->8080/tcp, :::32824->8080/tcp, 
0.0.0.0:32823->26257/tcp, :::32823->26257/tcp   config-hub-granit-schemas-for-jooq-1

The other aspect of this is that as per documentation. DMP should simply create config-hub-granit-schemas-for-jooq-2 and continue.

  • Docker version 25.0.2, build 29cf629
  • Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
  • Maven home: /home/o/sw/prog/maven-3.9.9
  • Java version: 21.0.7, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64
  • Default locale: en_US, platform encoding: UTF-8
  • OS name: "linux", version: "6.8.0-60-generic", arch: "amd64", family: "unix"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions