Docker cookbook and idempotency

I love the docker cookbook - thanks to those who created and maintain it!

That said, there are a few things I’m trying to understand better. Specifically, how does idempotency work with the docker_image :build action? Does this rebuild the image on every chef run, or only when the build context has changed?

Currently, I am using a notification to rebuild the image when the build context has changed. But this is unsatisfactory because when the context is already up to date but the image is outdated or missing, it will not trigger a rebuild.

How do I solve this?

Kevin Keane

The NetTech

http://www.4nettech.com

Our values: Privacy, Liberty, Justice

See https://www.4nettech.com/corp/the-nettech-values.html

Hi Kevin

Unfortunately, :build will perform work on every chef-client run. There
isn't really a way to "check" to see if the image contents are out of date
given the inputs.

I'd have your build context notify a docker_image with the
:build_if_missing action set.

-s

On Tue, Sep 1, 2015 at 12:21 AM, Kevin Keane Subscription <
subscription@kkeane.com> wrote:

I love the docker cookbook - thanks to those who created and maintain it!

That said, there are a few things I'm trying to understand better.
Specifically, how does idempotency work with the docker_image :build
action? Does this rebuild the image on every chef run, or only when the
build context has changed?

Currently, I am using a notification to rebuild the image when the build
context has changed. But this is unsatisfactory because when the context is
already up to date but the image is outdated or missing, it will not
trigger a rebuild.

How do I solve this?

Kevin Keane

The NetTech

http://www.4nettech.com

Our values: Privacy, Liberty, Justice

See https://www.4nettech.com/corp/the-nettech-values.html