Giter Site home page Giter Site logo

Comments (8)

rhuss avatar rhuss commented on August 18, 2024

That's interesting. In case of the error, if you retry to delete the container sometimes later, does it the work ?

I ask because I could imagine to simply retry the removal if the first try fails (instead of inserting a pause from the very beginning since that problem never happened to me until now).

Another question: Did you really slept 20 minutes (1000 seconds) or this a typo in your command above (and you meant 1000 ms) ?

from docker-maven-plugin.

chris-snider avatar chris-snider commented on August 18, 2024

It should have been a sleep 1, not the 1000 for command line. I used 1000 (ms) for an update to the AbstractDockerMojo.java.

Attempting to remove the container after getting the error results in another error indicating the container was not found. Restarting the docker engine showed the same container ID, but a different name associated. Executing docker rm ImgID succeeds and removes the container(s).

I added a Thread.sleep(1000) just before the access.removeContainer in the AbstractDockerMojo as

            if (!keepContainer) {
                try {
                    Thread.sleep(1000); //need to give the docker engine the split second to finish
                } catch (InterruptedException e) {
                    //just eat it, eat it...
                }
                // Remove the container
                access.removeContainer(container);
            }

And this successfully completes my integration tests from starting all my containers to stopping and removing them all.

from docker-maven-plugin.

rhuss avatar rhuss commented on August 18, 2024

Ok, this seems that docker has indeed multiple issues when removing images (search for docker run rm busy). So its probably a good idea to add this pause as a workaround (wonder if it could be 500ms as well ;-)

'will add this for the next release, maybe even configurable (in the <wait> section).

from docker-maven-plugin.

chris-snider avatar chris-snider commented on August 18, 2024

I believe 500 ms will work. It seems that it just has to have a pause of some kind to complete the previous command.

from docker-maven-plugin.

rhuss avatar rhuss commented on August 18, 2024

Just pust a new snapshot 0.10.6-SNAPSHOT which allow the specificaton on a grace period after stopping a container. See #70 for details how to configure this.

Does this fix your issue ?

from docker-maven-plugin.

chris-snider avatar chris-snider commented on August 18, 2024

Is the change adding an additional tag to the already existing wait? Such as

<wait>
    <log>Server started in</log>
    <!--... but a max of 20 seconds-->
    <time>20000</time>
    <!-- Wait 500 ms between stopping and removing the container -->
    <shutdown>500</shutdown>
</wait>

from docker-maven-plugin.

rhuss avatar rhuss commented on August 18, 2024

Yes, that's it.

from docker-maven-plugin.

chris-snider avatar chris-snider commented on August 18, 2024

I can confirm that the new shutdown works. I was able to launch, test, shutdown and remove my containers.

from docker-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.