build docker image with label $BUILD_DATE

Alen Cappelletti 971 Reputation points
2023-05-11T09:56:27.73+00:00

Hi,

I'm using visual studio 2022 with a simple Dockerfile on windows.

I build a image with success but 2 label are not valued correctly, with this line from

Developer Powershell:
docker build --no-cache --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t test .

Do I have to create an ARG and value it in the docker file? Or can I do in the command line... like above?
This $BUILD_VERSION is something related to VS?
How do I value it?

Thanks Alen

LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.version=$BUILD_VERSION
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,793 questions
{count} votes