forge icon indicating copy to clipboard operation
forge copied to clipboard

Ability to tag metadata to the docker image

Open makeittotop opened this issue 8 years ago • 2 comments

Not sure if there is already an option to hand-craft the docker image build name with chosen metadata (example: deployment 'track', version etc) in which case this is probably not needed.

Else it'd be good to differentiate between different images to help perform certain administrative actions.

makeittotop avatar Aug 31 '17 07:08 makeittotop

There isn't any such ability currently, but we could certainly add some flexibility here.

The way forge works depends on being able to deterministically compute the image name based on a hash of all the input sources. You can think of this as an automatically computed "implementation version" (as opposed to a semantic API version). This hash needs to be part of the image name in order for forge to be able to cache docker builds, but we could certainly have a component of the image name that is customizable.

I could also add the ability to add custom labels to docker images. That might be a good place to put some of that information as well.

rhs avatar Aug 31 '17 10:08 rhs

This is, now that I think about it, kind of increasingly important now that #33 is implemented. Now that you can change the build config depending on environment variables, you can end up with different images with the same project checksum.

Maybe something like:

containers:
  - dockerfile: ./Dockerfile
    tag: {{version}}{%if env.DEBUG %}-debug{% endif %}

With a validation that {{version}} is included in the tag

tristanpemble avatar Aug 31 '17 20:08 tristanpemble