Coder Social home page Coder Social logo

Comments (4)

Justin-DynamicD avatar Justin-DynamicD commented on June 29, 2024

So, I've not tried doing what you're doing per-say, but My guess is going to be that the "p20" image may not name match exactly with what you're importing? if you "break open" the module, image import and maintenance is a bunch of exec calls which is much trickier to keep declarative, and so you need need to do your part and make sure all names line up exactly. Also, make sure that Exec['/opt/relaunch-app.sh'] is set to refreshonly => true, otherwise it will run every pass no matter how perfect everything else is.

As an aside, you really should setup a docker registry, as what you're effectively doing here is copying an image then running a custom bash to redeploy the containers, which could be made much more reliable (not to mention closer to as intended) by simply running a docker registry and pushing your images there. Then this whole process could be a single docker::run instead of a file copy, docker image, then script to kick things off.

docker::run { 'p20':
      image   => "myregistry.company.com/p20:latest",
    }

This will basically always pull the latest image from the registry whenever it changes and restart the container on it's own.

from garethr-docker.

kr428 avatar kr428 commented on June 29, 2024

@Justin-DynamicD Thanks a bunch for your feedback. So I'll have a look into setting up a docker registry. So far I wanted to avoid that in order not to introduce yet one more required runtime dependency but maybe it indeed will ease things. What I actually want to achieve is having sort of an automated procedure that picks up new images as soon as they are available and restarts containers then in a meaningful way without too much manual automation...

from garethr-docker.

Justin-DynamicD avatar Justin-DynamicD commented on June 29, 2024

I can understand keeping the unnecessary stuff out, but in this case it makes things sooo much easier.

Any rate, if you want to move images around via tmp copy, I'd just take a close look at how your images and zips are named, as it looks like the module uses all of it interchangeably. Hope that gets you out of the jam you're in.

from garethr-docker.

kr428 avatar kr428 commented on June 29, 2024

Ok you got me. I spent most of yesterdays time setting up a local docker registry, and though this is not completely perfect it seems worth the effort. Still missing, though: By now puppet will pull new images off the registry if there are any (good), but it will apparently not restart any running containers.

Maybe this isn't even completely dumb as there are several instances of the same service running on that particular host (frontend by haproxy), and they shouldn't all go down and come back up at the same random time. Do you have any good recommendations to share on how to do something like this, like: "There are four containers running on top of this image, and if the image is updated, they should be restarted one by one"? Is this even possible with puppet, or will I need more sophisticated means of orchestration here?

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.