Code Monkey home page Code Monkey logo

Comments (7)

hackzilla avatar hackzilla commented on August 16, 2024

I think I've figured out why I'm having issues.

Error response from daemon: Conflict, cannot force delete 0f51007ffb60 because the running container c513b6422ad9 is using it (docker untagged the image), stop it and retry
2014/09/16 07:33:43 Error: failed to remove one or more images

Looks like docker is removing the image name, but leaving the container processes behind. When I try to use the same tag name, it still exists.

from garethr-docker.

kitplummer avatar kitplummer commented on August 16, 2024

I think this is what I'm looking for. Want to make sure I'm following your logic. First, delete the existing image, get the latest, then restart the container with the new latest - for each time the manifest is executed. This correct? If there isn't a new image, then the running container should get left alone? It'd be nice if you could just specify the tag name in the docker::run call right? So that the module would only update if the tag was different than the current running container.

from garethr-docker.

hackzilla avatar hackzilla commented on August 16, 2024

Similar.

Pull latest image.
If running image isn't latest, stop, remove, restart.
Every time the manifest is called.

from garethr-docker.

Luzifer avatar Luzifer commented on August 16, 2024

Would be a great improvement for me to have this. When using use_name => false the container is restarted as soon as I get a new image. With use_name => true the upstart script detects I already have a container named $name and just starts it. One solution might be to compare whether the current image hash equals the stored hash of the known container. If they match: Fine, start the known container. If they don't match: Throw it away and start a new one with the new image and the same name…

from garethr-docker.

solarkennedy avatar solarkennedy commented on August 16, 2024

I hacked mine to just docker rm all the time, so refresh events restart the container regardless:
Yelp/garethr-docker@garethr:master...master#diff-e8ee1e07315f2846862e4461968f10d0R88

from garethr-docker.

bchecketts avatar bchecketts commented on August 16, 2024

Not a complete puppet-based solution, but my PR at #209 provides a way to stop and restart the container with the newest image via the init script on the machine.

You'd simply run /etc/init.d/docker-YOURNAME cleanRestart

That will stop the container, remove the file in /var/run/docker-YOURNAME.cid, then restart the container with a fresh 'docker pull'. Note that you could 'docker pull' before running the init command to speed that up so that the current image is already on the machine.

from garethr-docker.

garethr avatar garethr commented on August 16, 2024

After much back and forth and great work by @solarkennedy this should now be resolved. Thanks all https://github.com/garethr/garethr-docker/pull/222/files

from garethr-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.