From 5072eef93dfe45b5269b6350a1487dc2b639c827 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 31 May 2020 16:29:11 +0200 Subject: [PATCH] add date label, switch mirror --- Dockerfile | 6 +++--- Jenkinsfile | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45a9a18..8ff8a44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine as build ARG VERSION ENV ALPINE_SERIES 3.12 -ENV ALPINE_MIRROR https://uk.alpinelinux.org/alpine/v${ALPINE_SERIES} +ENV ALPINE_MIRROR https://ftp.halifax.rwth-aachen.de/alpine/v${ALPINE_SERIES} ENV ALPINE_ARCH x86_64 WORKDIR /root @@ -17,7 +17,7 @@ RUN set -xo pipefail; apk add --no-cache curl gnupg &&\ FROM scratch ARG VERSION -LABEL version.alpine=$VERSION +ARG DATE COPY --from=build /dest / CMD ["/bin/sh"] - +LABEL version.alpine=$VERSION build.date=$DATE diff --git a/Jenkinsfile b/Jenkinsfile index 3a5fb0a..8d20711 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,7 @@ repo = "zknt" version = "3.12.0" registry = "reg.zknt.org" registry_credentials = "6ff44976-23cd-4cc2-902c-de8c340e65e5" +timeStamp = Calendar.getInstance().getTime().format('YYYY-MM-dd',TimeZone.getTimeZone('UTC')) pipeline { agent any @@ -12,7 +13,7 @@ pipeline { withDockerRegistry([ credentialsId: registry_credentials, url: "https://"+registry ]) { echo 'Starting to build docker image' script { - def customImage = docker.build(registry+'/'+repo+'/'+project, "--build-arg VERSION=$version .") + def customImage = docker.build(registry+'/'+repo+'/'+project, "--build-arg VERSION=$version --build-arg DATE=$timeStamp .") customImage.push(version) customImage.push(version.split(/\./)[0,1].join('.')) customImage.push(version.split(/\./)[0])