Closed alex-old-user closed 10 months ago
This is expected.
When you set labels using the LABEL
instruction in the Dockerfile or using the docker label
command or --label
with build command, the labels are stored in the image's configuration (.Config.Labels
). These labels provide metadata about the image itself.
However, when a container is created from the image, the runtime configuration of the container is stored in the .ContainerConfig
field. This includes information about the running container, and it does not include the labels from the image. Therefore, .ContainerConfig.Labels
remains null.
More info:
Hello, I'm not sure whether it's a bug or by design. When I do sth simple as
and then check the image with
docker inspect
,.Config.Labels
is populated with the label, but.ContainerConfig.Labels
is set tonull
. Setting the label in Dockerfile has the same result. Is this the expected behavior for the action? Is there a way to set.ContainerConfig.Labels
?thanks