From b54d69ca9974db9cdf71a987be59f58fe5df3dba Mon Sep 17 00:00:00 2001 From: Shiva Date: Thu, 11 Apr 2024 12:04:45 +0530 Subject: [PATCH] Add labels to Docker image Signed-off-by: Shiva --- inji-verify/Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/inji-verify/Dockerfile b/inji-verify/Dockerfile index 76d4d1a9..f115ca3e 100644 --- a/inji-verify/Dockerfile +++ b/inji-verify/Dockerfile @@ -22,6 +22,18 @@ RUN npm run build # Use an official Nginx image as the final production image FROM nginx:latest +# Add the ARGs as environment variables +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME + +# Copy labels from build stage +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + # Copy the built React app from the build container to the Nginx container COPY --from=build /app/build /usr/share/nginx/html