Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nifi-docker/dockerhub/DockerRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ DOCKER_IMAGE="$(grep -Ev '(^#|^\s*$|^\s*\t*#)' DockerImage.txt)"
NIFI_IMAGE_VERSION="$(echo "${DOCKER_IMAGE}" | cut -d : -f 2)"

echo "Running Docker Image: ${DOCKER_IMAGE}"
docker run -d --name "nifi-${NIFI_IMAGE_VERSION}" -p 8080:8080 -p 8443:8443 -p 10000:10000 -p 8000:8000 -p 8181:8181 "${DOCKER_IMAGE}"
docker run -d --name "nifi-${NIFI_IMAGE_VERSION}" -p 8443:8443 -p 10000:10000 -p 8000:8000 "${DOCKER_IMAGE}"
11 changes: 8 additions & 3 deletions nifi-docker/dockerhub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -16,8 +17,8 @@
# under the License.
#

ARG IMAGE_NAME=eclipse-temurin
ARG IMAGE_TAG=11-jre
ARG IMAGE_NAME=bellsoft/liberica-openjdk-alpine
ARG IMAGE_TAG=21
FROM ${IMAGE_NAME}:${IMAGE_TAG}
ARG MAINTAINER="Apache NiFi <dev@nifi.apache.org>"
LABEL maintainer="${MAINTAINER}"
Expand Down Expand Up @@ -48,6 +49,8 @@ RUN groupadd -g ${GID} nifi || groupmod -n nifi `getent group ${GID} | cut -d: -
&& chown -R nifi:nifi ${NIFI_BASE_DIR} \
&& apt-get update \
&& apt-get install -y jq xmlstarlet procps unzip \
&& apt-get install -y python3 \
&& apt-get install -y python3-pip \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand All @@ -73,6 +76,7 @@ RUN curl -fSL ${MIRROR_BASE_URL}/${NIFI_BINARY_PATH} -o ${NIFI_BASE_DIR}/nifi-${
&& mkdir -p ${NIFI_HOME}/flowfile_repository \
&& mkdir -p ${NIFI_HOME}/content_repository \
&& mkdir -p ${NIFI_HOME}/provenance_repository \
&& mkdir -p ${NIFI_HOME}/python_extensions \
&& mkdir -p ${NIFI_HOME}/state \
&& mkdir -p ${NIFI_LOG_DIR} \
&& ln -s ${NIFI_HOME} ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}
Expand All @@ -83,13 +87,14 @@ VOLUME ${NIFI_LOG_DIR} \
${NIFI_HOME}/flowfile_repository \
${NIFI_HOME}/content_repository \
${NIFI_HOME}/provenance_repository \
${NIFI_HOME}/python_extensions \
${NIFI_HOME}/state

# Clear nifi-env.sh in favour of configuring all environment variables in the Dockerfile
RUN echo "#!/bin/sh\n" > $NIFI_HOME/bin/nifi-env.sh

# Web HTTP(s) & Socket Site-to-Site Ports
EXPOSE 8080 8443 10000 8000
EXPOSE 8443/tcp 10000/tcp 8000/tcp

WORKDIR ${NIFI_HOME}

Expand Down
5 changes: 4 additions & 1 deletion nifi-docker/dockerhub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

## Latest changes

### 2.0.0

- Changed base image to bellsoft/liberica-openjdk-debian:21 as NiFi 2.0.0 requires Java 21

### 1.19.0

- Changed base image to eclipse-temurin:11-jre as openjdk:8-jre is no longer maintained
Expand Down Expand Up @@ -215,7 +219,6 @@ can be published to the host.

| Function | Property | Port |
|--------------------------|-------------------------------|-------|
| HTTP Port | nifi.web.http.port | 8080 |
| HTTPS Port | nifi.web.https.port | 8443 |
| Remote Input Socket Port | nifi.remote.input.socket.port | 10000 |
| JVM Debugger | java.arg.debug | 8000 |
Expand Down
32 changes: 6 additions & 26 deletions nifi-docker/dockerhub/sh/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ if [ ! -z "${NIFI_JVM_DEBUGGER}" ]; then
uncomment "java.arg.debug" ${nifi_bootstrap_file}
fi

# Setup NiFi to use Python
uncomment "nifi.python.command" ${nifi_props_file}
prop_replace 'nifi.python.extensions.source.directory.default' "${NIFI_HOME}/python_extensions"

# Establish baseline properties
prop_replace 'nifi.web.https.port' "${NIFI_WEB_HTTPS_PORT:-8443}"
prop_replace 'nifi.web.https.host' "${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}"
Expand All @@ -50,32 +54,8 @@ prop_replace 'keystoreType' "PKCS12" ${nifi_t
prop_replace 'truststore' "${NIFI_HOME}/conf/truststore.p12" ${nifi_toolkit_props_file}
prop_replace 'truststoreType' "PKCS12" ${nifi_toolkit_props_file}

if [ -n "${NIFI_WEB_HTTP_PORT}" ]; then
prop_replace 'nifi.web.https.port' ''
prop_replace 'nifi.web.https.host' ''
prop_replace 'nifi.web.http.port' "${NIFI_WEB_HTTP_PORT}"
prop_replace 'nifi.web.http.host' "${NIFI_WEB_HTTP_HOST:-$HOSTNAME}"
prop_replace 'nifi.remote.input.secure' 'false'
prop_replace 'nifi.cluster.protocol.is.secure' 'false'
prop_replace 'nifi.security.keystore' ''
prop_replace 'nifi.security.keystoreType' ''
prop_replace 'nifi.security.truststore' ''
prop_replace 'nifi.security.truststoreType' ''
prop_replace 'nifi.security.user.login.identity.provider' ''
prop_replace 'keystore' '' ${nifi_toolkit_props_file}
prop_replace 'keystoreType' '' ${nifi_toolkit_props_file}
prop_replace 'truststore' '' ${nifi_toolkit_props_file}
prop_replace 'truststoreType' '' ${nifi_toolkit_props_file}
prop_replace 'baseUrl' "http://${NIFI_WEB_HTTP_HOST:-$HOSTNAME}:${NIFI_WEB_HTTP_PORT}" ${nifi_toolkit_props_file}

if [ -n "${NIFI_WEB_PROXY_HOST}" ]; then
echo 'NIFI_WEB_PROXY_HOST was set but NiFi is not configured to run in a secure mode. Unsetting nifi.web.proxy.host.'
prop_replace 'nifi.web.proxy.host' ''
fi
else
if [ -z "${NIFI_WEB_PROXY_HOST}" ]; then
echo 'NIFI_WEB_PROXY_HOST was not set but NiFi is configured to run in a secure mode. The NiFi UI may be inaccessible if using port mapping or connecting through a proxy.'
fi
if [ -z "${NIFI_WEB_PROXY_HOST}" ]; then
echo 'NIFI_WEB_PROXY_HOST was not set but NiFi is configured to run in a secure mode. The NiFi UI may be inaccessible if using port mapping or connecting through a proxy.'
fi

prop_replace 'nifi.cluster.is.node' "${NIFI_CLUSTER_IS_NODE:-false}"
Expand Down
17 changes: 11 additions & 6 deletions nifi-docker/dockermaven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -15,9 +16,8 @@
# specific language governing permissions and limitations
# under the License.
#

ARG IMAGE_NAME=eclipse-temurin
ARG IMAGE_TAG=11-jre
ARG IMAGE_NAME=bellsoft/liberica-openjdk-debian
ARG IMAGE_TAG=21
FROM ${IMAGE_NAME}:${IMAGE_TAG} AS artifactbase
ARG MAINTAINER="Apache NiFi <dev@nifi.apache.org>"
LABEL maintainer="${MAINTAINER}"
Expand Down Expand Up @@ -57,16 +57,17 @@ RUN mkdir -p ${NIFI_HOME}/conf \
&& mkdir -p ${NIFI_HOME}/flowfile_repository \
&& mkdir -p ${NIFI_HOME}/content_repository \
&& mkdir -p ${NIFI_HOME}/provenance_repository \
&& mkdir -p ${NIFI_HOME}/python_extensions \
&& mkdir -p ${NIFI_HOME}/state \
&& mkdir -p ${NIFI_LOG_DIR}

FROM ${IMAGE_NAME}:${IMAGE_TAG}
ARG MAINTAINER="Apache NiFi <dev@nifi.apache.org>"
LABEL maintainer="${MAINTAINER}"

#
ARG UID=1000
ARG GID=1000

#
ENV NIFI_BASE_DIR /opt/nifi
ENV NIFI_HOME ${NIFI_BASE_DIR}/nifi-current
ENV NIFI_TOOLKIT_HOME ${NIFI_BASE_DIR}/nifi-toolkit-current
Expand All @@ -78,6 +79,9 @@ RUN groupadd -g ${GID} nifi || groupmod -n nifi `getent group ${GID} | cut -d: -
&& useradd --shell /bin/bash -u ${UID} -g ${GID} -m nifi \
&& apt-get update \
&& apt-get install -y jq xmlstarlet procps \
&& apt-get install -y python3 \
&& apt-get install -y python3-pip \
&& apt-get install -y python3-venv \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand All @@ -90,6 +94,7 @@ VOLUME ${NIFI_LOG_DIR} \
${NIFI_HOME}/flowfile_repository \
${NIFI_HOME}/content_repository \
${NIFI_HOME}/provenance_repository \
${NIFI_HOME}/python_extensions \
${NIFI_HOME}/state

USER nifi
Expand All @@ -98,7 +103,7 @@ USER nifi
RUN echo "#!/bin/sh\n" > $NIFI_HOME/bin/nifi-env.sh

# Web HTTP(s) & Socket Site-to-Site Ports
EXPOSE 8080 8443 10000 8000
EXPOSE 8443/tcp 10000/tcp 8000/tcp

WORKDIR ${NIFI_HOME}

Expand Down
6 changes: 4 additions & 2 deletions nifi-docker/dockermaven/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ docker run -d --name "nifi-${TAG}-integration-test" "apache/nifi:${TAG}"
IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "nifi-${TAG}-integration-test")

for i in $(seq 1 10) :; do
echo "Iteration: ${i}"
echo "Waiting for NiFi startup - iteration: ${i}"
if docker exec "nifi-${TAG}-integration-test" bash -c " echo Running < /dev/tcp/${IP}/8443"; then
echo "NiFi found active on port 8443"
break
fi
sleep 10
done

echo "Checking NiFi REST API Access"
test "200" = "$(docker exec "nifi-${TAG}-integration-test" bash -c "curl -s -o /dev/null -w %{http_code} -k https://${IP}:8443/nifi-api/access")"
# Return code is 400 instead of 200 because of an invalid SNI
test "400" = "$(docker exec "nifi-${TAG}-integration-test" bash -c "curl -s -o /dev/null -w %{http_code} -k https://${IP}:8443/nifi-api/access")"

echo "Stopping NiFi container"
time docker stop "nifi-${TAG}-integration-test"
1 change: 1 addition & 0 deletions nifi-docker/dockermaven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
</tags>
<dockerFile>Dockerfile</dockerFile>
<contextDir>${project.basedir}</contextDir>
<optimise>true</optimise>
<args>
<IMAGE_NAME>${docker.image.name}</IMAGE_NAME>
<IMAGE_TAG>${docker.image.tag}</IMAGE_TAG>
Expand Down
4 changes: 2 additions & 2 deletions nifi-docker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ language governing permissions and limitations under the License. -->

<properties>
<nifi.version>${project.version}</nifi.version>
<docker.image.name>eclipse-temurin</docker.image.name>
<docker.image.tag>11-jre</docker.image.tag>
<docker.image.name>bellsoft/liberica-openjdk-debian</docker.image.name>
<docker.image.tag>21</docker.image.tag>
</properties>

<modules>
Expand Down