Github user jtstorck commented on a diff in the pull request: https://github.com/apache/nifi/pull/2747#discussion_r195304620 --- Diff: nifi-docker/dockermaven/Dockerfile --- @@ -26,23 +26,33 @@ ARG NIFI_BINARY ENV NIFI_BASE_DIR /opt/nifi ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION - -# Setup NiFi user -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 \ - && chown -R nifi:nifi $NIFI_BASE_DIR +ENV NIFI_PID_DIR=${NIFI_HOME}/run +ENV NIFI_LOG_DIR=${NIFI_HOME}/logs ADD $NIFI_BINARY $NIFI_BASE_DIR -RUN chown -R nifi:nifi $NIFI_HOME +# Setup NiFi user and create necessary directories +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 \ + && mkdir -p $NIFI_BASE_DIR/data \ + && mkdir -p $NIFI_BASE_DIR/flowfile_repository \ + && mkdir -p $NIFI_BASE_DIR/content_repository \ + && mkdir -p $NIFI_BASE_DIR/provenance_repository \ + && mkdir -p $NIFI_LOG_DIR \ + && chown -R nifi:nifi ${NIFI_BASE_DIR} \ + && apt-get update \ + && apt-get install -y jq xmlstarlet procps USER nifi -# Web HTTP Port & Remote Site-to-Site Ports -EXPOSE 8080 8181 +# 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 -WORKDIR $NIFI_HOME +WORKDIR ${NIFI_HOME} # Startup NiFi ENTRYPOINT ["bin/nifi.sh"] -CMD ["run"] +CMD ["run"] --- End diff -- I tried to use Ctrl-C after NiFi was successfully up and running to kill the container. I had to open a new shell and use docker kill to bring it down. Not a big deal, I still think that's due to docker and having started the container in a non-interactive and non-detached method. For the logging, I'm not sure if there's a reason why the two docker modules have different wrapper scripts. You could check with @apiri, but most likely it'd be good to bring them in line. It doesn't have to be done in this PR, though it'd be nice to get this into the NiFi 1.7.0 release if no one disagrees with it.
---