2016-12-29 15:36:04 -05:00
|
|
|
# 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
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
#
|
|
|
|
|
2017-06-11 15:22:51 -04:00
|
|
|
FROM openjdk:8-jre
|
2017-11-28 20:00:32 -05:00
|
|
|
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>"
|
|
|
|
LABEL site="https://nifi.apache.org"
|
2016-12-29 15:36:04 -05:00
|
|
|
|
2017-01-13 16:56:49 -05:00
|
|
|
ARG UID=1000
|
2017-06-11 15:22:51 -04:00
|
|
|
ARG GID=1000
|
2018-01-12 15:19:15 -05:00
|
|
|
ARG NIFI_VERSION=1.6.0
|
2017-06-11 15:22:51 -04:00
|
|
|
ARG MIRROR=https://archive.apache.org/dist
|
2016-12-29 15:36:04 -05:00
|
|
|
|
2017-06-11 15:22:51 -04:00
|
|
|
ENV NIFI_BASE_DIR /opt/nifi
|
2017-11-28 20:00:32 -05:00
|
|
|
ENV NIFI_HOME=${NIFI_BASE_DIR}/nifi-${NIFI_VERSION} \
|
|
|
|
NIFI_BINARY_URL=/nifi/${NIFI_VERSION}/nifi-${NIFI_VERSION}-bin.tar.gz
|
|
|
|
|
|
|
|
ADD sh/ /opt/nifi/scripts/
|
2016-12-29 15:36:04 -05:00
|
|
|
|
|
|
|
# Setup NiFi user
|
2017-11-28 20:00:32 -05:00
|
|
|
RUN groupadd -g ${GID} nifi || groupmod -n nifi `getent group ${GID} | cut -d: -f1` \
|
|
|
|
&& useradd --shell /bin/bash -u ${UID} -g ${GID} -m nifi \
|
|
|
|
&& mkdir -p ${NIFI_HOME}/conf/templates \
|
2017-11-28 20:00:32 -05:00
|
|
|
&& chown -R nifi:nifi ${NIFI_BASE_DIR} \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y jq xmlstarlet
|
2016-12-29 15:36:04 -05:00
|
|
|
|
2017-06-11 15:22:51 -04:00
|
|
|
USER nifi
|
2016-12-29 15:36:04 -05:00
|
|
|
|
2017-06-11 15:22:51 -04:00
|
|
|
# Download, validate, and expand Apache NiFi binary.
|
2017-11-28 20:00:32 -05:00
|
|
|
RUN curl -fSL ${MIRROR}/${NIFI_BINARY_URL} -o ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz \
|
|
|
|
&& echo "$(curl https://archive.apache.org/dist/${NIFI_BINARY_URL}.sha256) *${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz" | sha256sum -c - \
|
|
|
|
&& tar -xvzf ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz -C ${NIFI_BASE_DIR} \
|
|
|
|
&& rm ${NIFI_BASE_DIR}/nifi-${NIFI_VERSION}-bin.tar.gz \
|
|
|
|
&& chown -R nifi:nifi ${NIFI_HOME}
|
2016-12-29 15:36:04 -05:00
|
|
|
|
2017-11-28 20:00:32 -05:00
|
|
|
# Web HTTP(s) & Socket Site-to-Site Ports
|
|
|
|
EXPOSE 8080 8443 10000
|
2016-12-29 15:36:04 -05:00
|
|
|
|
2017-11-28 20:00:32 -05:00
|
|
|
WORKDIR ${NIFI_HOME}
|
2016-12-29 15:36:04 -05:00
|
|
|
|
2017-11-28 20:00:32 -05:00
|
|
|
# Apply configuration and start NiFi
|
|
|
|
CMD ${NIFI_BASE_DIR}/scripts/start.sh
|