build docker image with label $BUILD_DATE

Alen Cappelletti
1,047
Reputation points
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
Developer technologies Visual Studio Other
5,451 questions
Sign in to answer