Giter Site home page Giter Site logo

Comments (5)

set321go avatar set321go commented on August 18, 2024

Looking at https://github.com/palantir/gradle-docker/blob/develop/src/main/groovy/com/palantir/gradle/docker/DockerRunPlugin.groovy

it seems that along with the block that add --rm in the run task there is

         dockerRemoveContainer.with {
            commandLine 'docker', 'rm', ext.name
        }

when does this task get called? should I call it manually?

from gradle-docker.

set321go avatar set321go commented on August 18, 2024

My workaround for that is

build.finalizedBy tasks.dockerStop
tasks.dockerStop.finalizedBy tasks.dockerRemoveContainer

from gradle-docker.

uschi2000 avatar uschi2000 commented on August 18, 2024

when you say "it fails", can you provide more details, please?

from gradle-docker.

set321go avatar set321go commented on August 18, 2024
$ docker run -d --rm -p 9080:8080 blah/blah:blah
Conflicting options: --rm and -d

it would be nice if the dockerRun task could encapsulate it's lifecycle to gradle but i'm not sure how that would be managed. What I mean here is that it would be nice not to care about stopping and removing the containers. I do understand that only suits some use cases like testing.

from gradle-docker.

uschi2000 avatar uschi2000 commented on August 18, 2024

Cool, thanks. For reference (https://docs.docker.com/engine/reference/run/#/detached--d): A container in detached mode cannot be automatically removed when it stops, this means you cannot use the --rm option with -d option.

from gradle-docker.

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.