From f6efb86f2a047a33425592af226db70860630a0c Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sun, 25 Jul 2021 15:37:38 -0600 Subject: [PATCH] feature(dockerfile): specify NGINX version via build-arg - build-arg for NGINX version - add labels incorporating NGINX version and internal version - add label to reference GIT commit for tagged release --- build/Dockerfile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index b7e7255..375e5e3 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,10 @@ -FROM nginx:mainline-alpine +# +# build AB-NGINX container (based on NGINX mainline) +# + +ARG NGINX_VERSION=1.21.1 +FROM nginx:${NGINX_VERSION}-alpine +ARG NGINX_VERSION # default uid and gid for nginx user ARG UID=8080 @@ -86,8 +92,11 @@ CMD [ "nginx", "-g", "daemon off;" ] # add build date and version labels ARG BUILD_DATE -LABEL org.opencontainers.image.version="1.21.1" -LABEL app.asifbacchus.docker.internalVersion="5.0-1.21.1" +ARG GIT_COMMIT +ARG INTERNAL_VERSION +LABEL org.opencontainers.image.revision=${GIT_COMMIT} +LABEL org.opencontainers.image.version=${NGINX_VERSION} +LABEL app.asifbacchus.docker.internalVersion=${INTERNAL_VERSION}-${NGINX_VERSION} LABEL org.opencontainers.image.created=${BUILD_DATE} #EOF