diff --git a/Jenkinsfile b/Jenkinsfile index 3ada6683e0..cbbd4e0e48 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,10 @@ import groovy.transform.Field import groovy.transform.stc.ClosureParams import groovy.transform.stc.SimpleType +@Field +String debianRelease = 'bullseye' +@Field +String debianSnapshot = '20220418' @Field String jdk = 'openjdk-17' @Field @@ -50,6 +54,7 @@ try def mainImage = mainImage(imageName("Main")) def dbImage = docker.build( imageName('Main', 'apache'), + '--build-arg DEBIAN_RELEASE=' + debianRelease + ' ' + 'conf/apache') shSilent "mkdir VaultHttpServiceDocumentRoot" shSilent "mkdir VaultHttpServiceDocumentRoot/myContent" @@ -216,6 +221,8 @@ try { def mainImage = docker.build( imageName('Github'), + '--build-arg DEBIAN_RELEASE=' + debianRelease + ' ' + + '--build-arg DEBIAN_SNAPSHOT=' + debianSnapshot + ' ' + '--build-arg JDK=' + jdk + ' ' + 'conf/github') @@ -267,6 +274,8 @@ try nodeCheckoutAndDelete { def ideaImage = docker.build( imageName('Idea'), + '--build-arg DEBIAN_RELEASE=' + debianRelease + ' ' + + '--build-arg DEBIAN_SNAPSHOT=' + debianSnapshot + ' ' + '--build-arg JDK=' + jdk + ' ' + '--build-arg IDEA=' + idea + ' ' + '--build-arg IDEA_SHA256=' + ideaSHA256 + ' ' + @@ -578,6 +587,8 @@ def mainImage(String imageName) { return docker.build( imageName, + '--build-arg DEBIAN_RELEASE=' + debianRelease + ' ' + + '--build-arg DEBIAN_SNAPSHOT=' + debianSnapshot + ' ' + '--build-arg JDK=' + jdk + ' ' + '--build-arg JENKINS_OWNER=' + env.JENKINS_OWNER + ' ' + 'conf/main') diff --git a/conf/apache/Dockerfile b/conf/apache/Dockerfile index e3f2d731de..835fe0e516 100644 --- a/conf/apache/Dockerfile +++ b/conf/apache/Dockerfile @@ -1,3 +1,4 @@ -FROM httpd:2.4.53-bullseye +ARG DEBIAN_RELEASE +FROM httpd:2.4.53-${DEBIAN_RELEASE} COPY httpd.conf /usr/local/apache2/conf/httpd.conf diff --git a/conf/github/Dockerfile b/conf/github/Dockerfile index 2034c85a5b..8a74530f8b 100644 --- a/conf/github/Dockerfile +++ b/conf/github/Dockerfile @@ -1,4 +1,6 @@ -FROM debian:bullseye-20220418 +ARG DEBIAN_RELEASE +ARG DEBIAN_SNAPSHOT +FROM debian:${DEBIAN_RELEASE}-${DEBIAN_SNAPSHOT} # corresponds to .github/workflows/ant.yml ARG JDK diff --git a/conf/idea/Dockerfile b/conf/idea/Dockerfile index 4430932943..5a6ac6e3d6 100644 --- a/conf/idea/Dockerfile +++ b/conf/idea/Dockerfile @@ -1,3 +1,8 @@ +# Any ARG before the first FROM can be used in all FROM instruction of the Dockerfile. +# https://docs.docker.com/reference/dockerfile/#understand-how-arg-and-from-interact +ARG DEBIAN_RELEASE +ARG DEBIAN_SNAPSHOT + FROM alpine:3.16.2 AS idea-fetcher RUN apk --no-cache add curl ARG IDEA @@ -11,7 +16,7 @@ curl \ EOF -FROM debian:bullseye-20220418 +FROM debian:${DEBIAN_RELEASE}-${DEBIAN_SNAPSHOT} ARG JDK RUN <