I have a dockerfile that creates a container that houses an API service. The dockerfile tags the image with a few annotations like so:
LABEL org.opencontainers.image.vendor="MyCompany"
LABEL org.opencontainers.image.created="2021-02-12T12:10:15Z"
LABEL org.opencontainers.image.version="2.0.5"
LABEL org.opencontainers.image.revision="<gitcommithash>"
I want to expose an endpoint on that API service, /api/version, that returns version information. The version information is already stamped on the container in the LABEL statements above. I was wondering if our API service inside the container would somehow be able to retrieve these annotations.
Can a container read its own LABEL annotations?