Github user jtstorck commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2747#discussion_r195262129
--- 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 --
Creating a container with:
`docker run -p 8080:8080 apache/nifi:1.7.0-SNAPSHOT-dockermaven`
results in NiFi starting successfully, but I'm unable to control-c out of
the container. I'm not a docker expert, but I would expect that hitting
control-c would kill the container. Although, since I didn't run it in
interactive mode, this is probably a docker thing, not specific to this
Dockerfile.
Starting the container with:
`docker run -d -p 8080:8080 apache/nifi:1.7.0-SNAPSHOT-dockermaven`
and then issuing:
`docker logs <container>`
I see the nifi-bootstrap output, but not the nifi-app.log and nifi-user.log
output. Would it be preferable to have this behavior?
---