How can I make a LABEL in a non-final build stage to persist to the generated image?

  docker, dockerfile

In Docker, I want a LABEL set in the first stage from a multi-stage build to be present in the generated docker image.

I’m trying the following in my Dockerfile:

FROM image-a
LABEL myLabelKey=myLabelValue
...

FROM image-b
...
ENTRYPOINT ...

I want myLabelKey to be present in the generated image, but it is not, how can I get this?

Source: Docker Questions

LEAVE A COMMENT