Github user pepov commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2747#discussion_r195312869
  
    --- 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've just pushed what hopefully fixes this issue once and for all. 
Entrypoint and command instructions have their gotchas, and we have to be 
careful with those. Also added a comment what and why I changed around the 
entrypoint, please see in the commit: 
https://github.com/apache/nifi/pull/2747/commits/8aef89bfd3ec7d1771e6dd835c53a1ba1f61dda3#diff-2cef119cd914e1b710d41b387a0b72b2R61


---

Reply via email to