You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ab...@apache.org on 2021/06/04 09:38:18 UTC

[nifi-minifi-cpp] branch main updated: MINIFICPP-1578 Upgrade OS versions in docker builds

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 876906f  MINIFICPP-1578 Upgrade OS versions in docker builds
876906f is described below

commit 876906faffe274268a8ea417ee28b4b44f0ce8d8
Author: Ferenc Gerlits <fg...@gmail.com>
AuthorDate: Tue Jun 1 18:48:53 2021 +0200

    MINIFICPP-1578 Upgrade OS versions in docker builds
    
    Signed-off-by: Arpad Boda <ab...@apache.org>
    
    This closes #1093
---
 .gitignore                          |  2 +-
 README.md                           | 12 ++++++------
 centos.sh                           |  4 ++--
 cmake/DockerConfig.cmake            |  4 ++--
 docker/DockerBuild.sh               | 17 +++++++++--------
 docker/centos/Dockerfile            |  5 ++---
 docker/debian/Dockerfile            |  8 ++------
 docker/fedora/Dockerfile            |  2 +-
 docker/{xenial => focal}/Dockerfile |  5 +++--
 9 files changed, 28 insertions(+), 31 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5926a60..60cce20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,8 +67,8 @@ __pycache__/
 
 # Ignore source files that have been placed in the docker directory during build
 docker/minificppsource
-docker/xenial/minificppsource
 docker/bionic/minificppsource
+docker/focal/minificppsource
 docker/debian/minificppsource
 docker/centos/minificppsource
 docker/fedora/minificppsource
diff --git a/README.md b/README.md
index 101280b..4e8a5f6 100644
--- a/README.md
+++ b/README.md
@@ -490,17 +490,17 @@ $ make docker-verify
 ```
 
 ### Building For Other Distros
-If you have docker installed on your machine you can build for CentOS 7, Fedora 29, Ubuntu 16, Ubuntu 18, and Debian 9 via our make docker commands. The following table
+If you have docker installed on your machine you can build for CentOS 8, Fedora 34, Ubuntu 18.04, Ubuntu 20.04, and Debian 10 via our make docker commands. The following table
 provides the command to build your distro and the output file in your build directory. Since the versions are limited ( except for Ubuntu ) we output the archive based on the distro's name.
 
 
 | Distro         | command           | Output File  |
 | ------------- |:-------------| :-----|
-| CentOS 7  | make centos | nifi-minifi-cpp-centos-$VERSION-bin.tar.gz
-| Debian 9  | make debian | nifi-minifi-cpp-debian-$VERSION-bin.tar.gz
-| Fedora 29  | make fedora | nifi-minifi-cpp-fedora-$VERSION-bin.tar.gz
-| Ubuntu 16  | make u16 | nifi-minifi-cpp-xenial-$VERSION-bin.tar.gz
-| Ubuntu 18  | make u18 | nifi-minifi-cpp-bionic-$VERSION-bin.tar.gz
+| CentOS 8  | make centos | nifi-minifi-cpp-centos-$VERSION-bin.tar.gz
+| Debian 10 (buster)  | make debian | nifi-minifi-cpp-debian-$VERSION-bin.tar.gz
+| Fedora 34  | make fedora | nifi-minifi-cpp-fedora-$VERSION-bin.tar.gz
+| Ubuntu 18.04 (bionic)  | make u18 | nifi-minifi-cpp-bionic-$VERSION-bin.tar.gz
+| Ubuntu 20.04 (focal)  | make u20 | nifi-minifi-cpp-focal-$VERSION-bin.tar.gz
 
 
 ### Snapcraft
diff --git a/centos.sh b/centos.sh
index 7eef91e..84b0f03 100644
--- a/centos.sh
+++ b/centos.sh
@@ -138,9 +138,9 @@ build_deps(){
                         INSTALLED+=("java-1.8.0-openjdk-devel")
                         INSTALLED+=("maven")
                     elif [ "$FOUND_VALUE" = "python" ]; then
-                        INSTALLED+=("python34-devel")
+                        INSTALLED+=("python36-devel")
                     elif [ "$FOUND_VALUE" = "lua" ]; then
-                        INSTALLED+=("lua-devel")
+                        INSTALLED+=("lua-libs")
                     elif [ "$FOUND_VALUE" = "gpsd" ]; then
                         INSTALLED+=("gpsd-devel")
                     elif [ "$FOUND_VALUE" = "libarchive" ]; then
diff --git a/cmake/DockerConfig.cmake b/cmake/DockerConfig.cmake
index e6d2040..5bb4107 100644
--- a/cmake/DockerConfig.cmake
+++ b/cmake/DockerConfig.cmake
@@ -124,7 +124,7 @@ add_custom_target(
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
 add_custom_target(
-    u16
+    u20
     COMMAND ${CMAKE_SOURCE_DIR}/docker/DockerBuild.sh
         -u 1000
         -g 1000
@@ -132,7 +132,7 @@ add_custom_target(
         -i release
         -c ENABLE_JNI=${ENABLE_JNI}
         -l ${CMAKE_BINARY_DIR}
-        -d xenial
+        -d focal
         -c BUILD_NUMBER=${BUILD_NUMBER}
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docker/)
 
diff --git a/docker/DockerBuild.sh b/docker/DockerBuild.sh
index 5f954d7..4641072 100755
--- a/docker/DockerBuild.sh
+++ b/docker/DockerBuild.sh
@@ -36,7 +36,7 @@ function usage {
   echo "-i, --image-type      Can be release or minimal (default: release)"
   echo "-u, --uid             User id to be used in the Docker image (default: 1000)"
   echo "-g, --gid             Group id to be used in the Docker image (default: 1000)"
-  echo "-d, --distro-name     Linux distribution build to be used for alternative builds (xenial|bionic|fedora|debian|centos)"
+  echo "-d, --distro-name     Linux distribution build to be used for alternative builds (bionic|focal|fedora|debian|centos)"
   echo "-l  --dump-location   Path where to the output dump to be put"
   echo "-c  --cmake-param     CMake parameter passed in PARAM=value format"
   echo "-h  --help            Show this help message"
@@ -117,18 +117,19 @@ TAG=""
 if [ "${IMAGE_TYPE}" != "release" ]; then
   TAG="${IMAGE_TYPE}-"
 fi
-
-TARGZ_TAG=""
 if [ -n "${DISTRO_NAME}" ]; then
   TAG="${TAG}${DISTRO_NAME}-"
-  TARGZ_TAG="${DISTRO_NAME}-"
 fi
-
 TAG="${TAG}${MINIFI_VERSION}"
-TARGZ_TAG="${TARGZ_TAG}${MINIFI_VERSION}"
-
 if [ -n "${BUILD_NUMBER}" ]; then
   TAG="${TAG}-${BUILD_NUMBER}"
+fi
+
+TARGZ_TAG="bin"
+if [ -n "${DISTRO_NAME}" ]; then
+  TARGZ_TAG="${TARGZ_TAG}-${DISTRO_NAME}"
+fi
+if [ -n "${BUILD_NUMBER}" ]; then
   TARGZ_TAG="${TARGZ_TAG}-${BUILD_NUMBER}"
 fi
 
@@ -150,5 +151,5 @@ echo "Docker Command: '$DOCKER_COMMAND'"
 DOCKER_BUILDKIT=1 ${DOCKER_COMMAND}
 
 if [ -n "${DUMP_LOCATION}" ]; then
-  docker run --rm --entrypoint cat "apacheminificpp:${TAG}" "/opt/minifi/build/nifi-minifi-cpp-${MINIFI_VERSION}-bin.tar.gz" > "${DUMP_LOCATION}/nifi-minifi-cpp-${TARGZ_TAG}-bin.tar.gz"
+  docker run --rm --entrypoint cat "apacheminificpp:${TAG}" "/opt/minifi/build/nifi-minifi-cpp-${MINIFI_VERSION}-bin.tar.gz" > "${DUMP_LOCATION}/nifi-minifi-cpp-${MINIFI_VERSION}-${TARGZ_TAG}.tar.gz"
 fi
diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile
index b27ba5c..e54ab4c 100644
--- a/docker/centos/Dockerfile
+++ b/docker/centos/Dockerfile
@@ -17,7 +17,7 @@
 #
 
 # First stage: the build environment
-FROM centos:7 AS build_deps
+FROM centos:8 AS build_deps
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
@@ -27,12 +27,11 @@ ARG MINIFI_VERSION
 ENV MINIFI_BASE_DIR /opt/minifi
 ENV MINIFI_HOME $MINIFI_BASE_DIR/nifi-minifi-cpp-$MINIFI_VERSION
 
-RUN yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel gcc g++ sudo git which maven make
+RUN yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel python36-devel gcc gcc-c++ sudo git which maven make cmake
 
 RUN mkdir -p $MINIFI_BASE_DIR
 COPY . ${MINIFI_BASE_DIR}
 
-
 FROM build_deps AS release
 ARG ENABLE_JNI
 # Perform the build
diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile
index 7e0d4b6..1691606 100644
--- a/docker/debian/Dockerfile
+++ b/docker/debian/Dockerfile
@@ -17,7 +17,7 @@
 #
 
 # First stage: the build environment
-FROM debian:stretch AS build_deps
+FROM debian:buster AS build_deps
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
@@ -28,11 +28,7 @@ ENV MINIFI_BASE_DIR /opt/minifi
 ENV MINIFI_HOME $MINIFI_BASE_DIR/nifi-minifi-cpp-$MINIFI_VERSION
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
 
-RUN echo "deb http://deb.debian.org/debian stretch-backports main" | tee -a /etc/apt/sources.list \
-    && echo "deb http://deb.debian.org/debian stretch-backports-sloppy main" | tee -a /etc/apt/sources.list \
-    && apt-get update && apt-get install -y openjdk-8-jdk libpython3.5-dev openjdk-8-source sudo git maven \
-    && apt-get -t stretch-backports-sloppy install -y libarchive13\
-    && apt-get -t stretch-backports install -y cmake
+RUN apt-get update && apt-get install -y openjdk-11-jdk openjdk-11-source libpython3.7-dev sudo git maven libarchive13 cmake
 
 RUN mkdir -p $MINIFI_BASE_DIR
 COPY . ${MINIFI_BASE_DIR}
diff --git a/docker/fedora/Dockerfile b/docker/fedora/Dockerfile
index 138d09b..108507f 100644
--- a/docker/fedora/Dockerfile
+++ b/docker/fedora/Dockerfile
@@ -17,7 +17,7 @@
 #
 
 # First stage: the build environment
-FROM fedora:29 AS build_deps
+FROM fedora:34 AS build_deps
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
diff --git a/docker/xenial/Dockerfile b/docker/focal/Dockerfile
similarity index 88%
rename from docker/xenial/Dockerfile
rename to docker/focal/Dockerfile
index cb68ff6..2b73ef4 100644
--- a/docker/xenial/Dockerfile
+++ b/docker/focal/Dockerfile
@@ -17,7 +17,7 @@
 #
 
 # First stage: the build environment
-FROM ubuntu:xenial AS build_deps
+FROM ubuntu:focal AS build_deps
 LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
 
 ARG MINIFI_VERSION
@@ -28,7 +28,8 @@ ENV MINIFI_BASE_DIR /opt/minifi
 ENV MINIFI_HOME $MINIFI_BASE_DIR/nifi-minifi-cpp-$MINIFI_VERSION
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
 
-RUN apt-get update && apt-get install -y openjdk-8-jdk openjdk-8-source sudo git maven autogen autoconf automake
+RUN apt update
+RUN DEBIAN_FRONTEND="noninteractive" apt install -y openjdk-8-jdk openjdk-8-source python3.9-dev sudo git maven autogen autoconf automake cmake
 
 RUN mkdir -p $MINIFI_BASE_DIR
 COPY . ${MINIFI_BASE_DIR}