[
https://issues.apache.org/jira/browse/NIFI-4057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090565#comment-16090565
]
ASF GitHub Bot commented on NIFI-4057:
--------------------------------------
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1910#discussion_r127826350
--- Diff: nifi-docker/dockermaven/Dockerfile ---
@@ -16,32 +16,33 @@
# under the License.
#
-FROM openjdk:8
-MAINTAINER Apache NiFi <[email protected]>
+FROM openjdk:8-jre
+LABEL maintainer "Apache NiFi <[email protected]>"
ARG UID=1000
-ARG GID=50
+ARG GID=1000
ARG NIFI_VERSION
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`
-RUN useradd --shell /bin/bash -u $UID -g $GID -m nifi
-RUN mkdir -p $NIFI_HOME
+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
+
+USER nifi
ADD $NIFI_BINARY $NIFI_BASE_DIR
RUN chown -R nifi:nifi $NIFI_HOME
--- End diff --
Going to merge this in as I don't believe we have a better way to work
around this for the local case and presumably there is not another way without
getting overly complex.
> Docker Image is twice as large as necessary
> -------------------------------------------
>
> Key: NIFI-4057
> URL: https://issues.apache.org/jira/browse/NIFI-4057
> Project: Apache NiFi
> Issue Type: Bug
> Components: Docker
> Affects Versions: 1.2.0, 1.3.0
> Reporter: Jordan Moore
> Priority: Minor
>
> By calling {{chown}} as a secondary {{RUN}} command, you effectively double
> the size of image by creating a Docker layer of the same size as the
> extracted binary.
> See GitHub discussion:
> https://github.com/apache/nifi/pull/1372#issuecomment-307592287
> *Expectation*
> The resultant Docker image should be no larger than the Base image + the size
> required by extracting the Nifi binaries.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)