-
I'm seeing some inconsistent behaviour trying to populate my image labels using shell expressions. I hope it is obvious what I am trying to achieve from my descriptions: LABEL org.opencontainers.image.version="$(git describe --tags --abbrev=0)"
LABEL org.opencontainers.image.revision="$(git rev-parse HEAD)" results in these labels in the image when I dump them:
That is, one expression is evaluated, the other not! I also tried this with Build platform information:
Happy to provide any other information required to diagnose this, or transform this into a bug issue if suitable. (I am aware that I could pass these expressions or values in a build script with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Quite embarrassed now, realising I guess shell expression expansion is not supported at all in Dockerfile Sorry if I wasted anyone's time trying to reproduce. |
Beta Was this translation helpful? Give feedback.
Quite embarrassed now, realising
0.2.6
was in fact hardcoded as the default in my build shell script:VER=${3:-0.2.6}
…--label org.opencontainers.image.version=$VER
before I decided to work on making this dynamic.I guess shell expression expansion is not supported at all in Dockerfile
LABEL
:/Sorry if I wasted anyone's time trying to reproduce.