You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sz...@apache.org on 2023/06/15 18:21:11 UTC

[nifi-minifi-cpp] 02/03: MINIFICPP-2136 Make base image an argument for all Docker images

This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 54a05763654a7a422f233d6c14a61f31601c53de
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Thu Jun 15 19:35:49 2023 +0200

    MINIFICPP-2136 Make base image an argument for all Docker images
    
    Closes #1588
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 cmake/DockerConfig.cmake     | 6 ++++++
 docker/DockerBuild.sh        | 2 +-
 docker/Dockerfile            | 6 +++---
 docker/bionic/Dockerfile     | 4 +++-
 docker/centos/Dockerfile     | 4 +++-
 docker/fedora/Dockerfile     | 4 +++-
 docker/focal/Dockerfile      | 4 +++-
 docker/rockylinux/Dockerfile | 4 +++-
 8 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/cmake/DockerConfig.cmake b/cmake/DockerConfig.cmake
index 7137cbcac..6eba75214 100644
--- a/cmake/DockerConfig.cmake
+++ b/cmake/DockerConfig.cmake
@@ -82,6 +82,7 @@ add_custom_target(
         -c DOCKER_PLATFORMS=${DOCKER_PLATFORMS}
         -c DOCKER_PUSH=${DOCKER_PUSH}
         -c DOCKER_TAGS=${DOCKER_TAGS}
+        -c DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
 add_custom_target(
@@ -98,6 +99,7 @@ add_custom_target(
         -c DOCKER_PLATFORMS=${DOCKER_PLATFORMS}
         -c DOCKER_PUSH=${DOCKER_PUSH}
         -c DOCKER_TAGS=${DOCKER_TAGS}
+        -c DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
 add_custom_target(
@@ -114,6 +116,7 @@ add_custom_target(
         -c DOCKER_PLATFORMS=${DOCKER_PLATFORMS}
         -c DOCKER_PUSH=${DOCKER_PUSH}
         -c DOCKER_TAGS=${DOCKER_TAGS}
+        -c DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
 add_custom_target(
@@ -130,6 +133,7 @@ add_custom_target(
         -c DOCKER_PLATFORMS=${DOCKER_PLATFORMS}
         -c DOCKER_PUSH=${DOCKER_PUSH}
         -c DOCKER_TAGS=${DOCKER_TAGS}
+        -c DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
 add_custom_target(
@@ -146,6 +150,7 @@ add_custom_target(
         -c DOCKER_PLATFORMS=${DOCKER_PLATFORMS}
         -c DOCKER_PUSH=${DOCKER_PUSH}
         -c DOCKER_TAGS=${DOCKER_TAGS}
+        -c DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
 add_custom_target(
@@ -164,6 +169,7 @@ add_custom_target(
         -c DOCKER_PLATFORMS=${DOCKER_PLATFORMS}
         -c DOCKER_PUSH=${DOCKER_PUSH}
         -c DOCKER_TAGS=${DOCKER_TAGS}
+        -c DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
 if (EXISTS ${CMAKE_SOURCE_DIR}/docker/test/integration/features)
diff --git a/docker/DockerBuild.sh b/docker/DockerBuild.sh
index 0bfeeb6bb..50127fe2c 100755
--- a/docker/DockerBuild.sh
+++ b/docker/DockerBuild.sh
@@ -100,7 +100,7 @@ while [[ $# -gt 0 ]]; do
       if [ "${ARR[0]}" == "BUILD_NUMBER" ]; then
         BUILD_NUMBER="${ARR[1]}"
       elif [ "${ARR[0]}" == "DOCKER_BASE_IMAGE" ]; then
-        BUILD_ARGS+=("--build-arg" "BASE_ALPINE_IMAGE=${ARR[1]}")
+        BUILD_ARGS+=("--build-arg" "BASE_IMAGE=${ARR[1]}")
       elif [ "${ARR[0]}" == "DOCKER_CCACHE_DUMP_LOCATION" ]; then
         DOCKER_CCACHE_DUMP_LOCATION="${ARR[1]}"
       elif [ "${ARR[0]}" == "DOCKER_SKIP_TESTS" ]; then
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 5d4af3ad6..6de245ac7 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -16,10 +16,10 @@
 # under the License.
 #
 
-ARG BASE_ALPINE_IMAGE="alpine:3.16"
+ARG BASE_IMAGE="alpine:3.16"
 
 # Build image
-FROM ${BASE_ALPINE_IMAGE} AS build
+FROM ${BASE_IMAGE} AS build
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
@@ -84,7 +84,7 @@ RUN export PATH=/usr/lib64/ccache/bin${PATH:+:${PATH}} && \
     tar -xzvf "${MINIFI_BASE_DIR}/build/nifi-minifi-cpp-${MINIFI_VERSION}.tar.gz" -C "${MINIFI_BASE_DIR}"
 
 # Release image
-FROM ${BASE_ALPINE_IMAGE} AS release
+FROM ${BASE_IMAGE} AS release
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG UID=1000
diff --git a/docker/bionic/Dockerfile b/docker/bionic/Dockerfile
index 41ac52461..d3ee06f1d 100644
--- a/docker/bionic/Dockerfile
+++ b/docker/bionic/Dockerfile
@@ -17,7 +17,9 @@
 #
 
 # First stage: the build environment
-FROM ubuntu:bionic AS build_deps
+ARG BASE_IMAGE="ubuntu:bionic"
+
+FROM ${BASE_IMAGE} AS build
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile
index b71a50031..99dc583a0 100644
--- a/docker/centos/Dockerfile
+++ b/docker/centos/Dockerfile
@@ -17,7 +17,9 @@
 #
 
 # First stage: the build environment
-FROM centos:7
+ARG BASE_IMAGE="centos:7"
+
+FROM ${BASE_IMAGE} AS build
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
diff --git a/docker/fedora/Dockerfile b/docker/fedora/Dockerfile
index 1f34ba776..dd93e0eab 100644
--- a/docker/fedora/Dockerfile
+++ b/docker/fedora/Dockerfile
@@ -17,7 +17,9 @@
 #
 
 # First stage: the build environment
-FROM fedora:34 AS build_deps
+ARG BASE_IMAGE="fedora:34"
+
+FROM ${BASE_IMAGE} AS build
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
diff --git a/docker/focal/Dockerfile b/docker/focal/Dockerfile
index 564c74154..4af6bbfab 100644
--- a/docker/focal/Dockerfile
+++ b/docker/focal/Dockerfile
@@ -17,7 +17,9 @@
 #
 
 # First stage: the build environment
-FROM ubuntu:focal AS build_deps
+ARG BASE_IMAGE="ubuntu:focal"
+
+FROM ${BASE_IMAGE} AS build
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
diff --git a/docker/rockylinux/Dockerfile b/docker/rockylinux/Dockerfile
index 5ab695323..7d9c96f58 100644
--- a/docker/rockylinux/Dockerfile
+++ b/docker/rockylinux/Dockerfile
@@ -15,7 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-FROM rockylinux:8
+ARG BASE_IMAGE="rockylinux:8"
+
+FROM ${BASE_IMAGE} AS build
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION