Skip to content

List all images and build only the ones that changed #16

Description

@Perados

Hi!

I am trying to use docker-bakery in my CI/CD pipelines. The goal is to, whenever someone merges to master, build only the images that changed, and their children, avoiding building the children twice if both the parent and the children changed.

This is easy locally, because you know which files you edited, so you just go to those and run the build command. In the CI/CD (I'm using Gitlab), I can list all the Docker.template files that changed since the last merge, but I still need to find a way to avoid building parent and child if both changed. My idea was to use the show-structure command and filter using that, but the output is very difficult to parse. I think adding a json output option would be very useful.

I also tried using the images' digests to detect if something changed or not, but those change every time, even if the image is exactly the same, I think this happens because of the BAKERY_BUILD_DATE env variable that changes every time automatically.

I am also open to suggestions as to how automate this. Maybe I am just doing everything wrong! 😄

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions