legend icon indicating copy to clipboard operation
legend copied to clipboard

Add IMAGE_VERSION label / env variables to the Legend docker images

Open claudiubelu opened this issue 3 years ago • 0 comments

Feature Request

Description of Problem:

Docker images can be retagged, or used as a base for custom images. When doing so, it is not as straight-forward to determine the version of Legend Engine / SDLC / Studio is installed in the container. Similarly, this happens when uploading OCI-image resources into charmhub.io, where only the image SHA is kept.

Simply put, there should be a way to determine an image's version, ideally without having to create / run a container with it (docker inspect will list the image's labels and set environment variables).

Potential Solutions:

Having an IMAGE_VERSION label and / or env variable would address this issue; that information could easily be found out by inspecting the image / SHA.

Dockerfile:

ARG VERSION="latest"

LABEL IMAGE_VERSION="$VERSION"

# An environment variable could also be seen from inside the container as well.
ENV IMAGE_VERSION="$VERSION"

This VERSION ARG could then be passed in when building the image:

docker build -t yourregistry/legend-studio:1.0.0 --build-arg VERSION=1.0.0 .

claudiubelu avatar Apr 18 '22 15:04 claudiubelu