You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by cricket007 <gi...@git.apache.org> on 2017/06/11 19:29:36 UTC

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

GitHub user cricket007 opened a pull request:

    https://github.com/apache/nifi/pull/1910

    NIFI-4057 Docker Image is twice as large as necessary

    Resulting Docker image in now 1.29 GB instead of 2.58 GB
    
    **Detailed changes**
    
      * Merging unnecessary layers
      * MAINTAINER is deprecated
      * Using JRE as base since JDK is not necessary
      * Remove GID as a build-arg since useradd adds a group id for us
      * Add ability to specify Apache mirror site to reduce load on Apache Archive
      * Create a define templates directory as a Docker volume
    
    ---
    
    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [X] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [X] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [X] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [X] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [X] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cricket007/nifi NIFI-4057

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1910.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1910
    
----
commit e4fdd3194a31356cc6597be1515f5597b19beaff
Author: Jordan Moore <mo...@avalonconsult.com>
Date:   2017-06-11T19:22:51Z

    NIFI-4057 Docker Image is twice as large as necessary
    
      * Merging unnecessary layers
      * MAINTAINER is deprecated
      * Using JRE as base since JDK is not necessary
      * Remove GID as a build-arg since useradd adds a group id for us
      * Add ability to specify Apache mirror site to reduce load on Apache Archive
      * Create a define templates directory as a Docker volume

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121291213
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    +    && mkdir -p $NIFI_HOME/conf/templates && chown -R nifi:nifi $NIFI_BASE_DIR
    +
    +USER nifi
     
     # Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $NIFI_BINARY_URL.sha256) *$NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz" | sha256sum -c - \
    +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
    +	&& rm $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    +    && chown -R nifi:nifi $NIFI_HOME
     
    -RUN chown -R nifi:nifi $NIFI_HOME
    +# Web HTTP Port & Remote Site-to-Site Ports
    +EXPOSE 8080 8181
     
    -# Web HTTP Port
    -EXPOSE 8080
    +WORKDIR $NIFI_HOME
     
    -# Remote Site-To-Site Port
    -EXPOSE 8181
    -
    -USER nifi
    +VOLUME conf/templates
     
    --- End diff --
    
    There are lots of files in conf/ that would likely be good candidates for VOLUME export (flow.xml.gz, nifi.properties, bootstrap.conf, etc.).  Maybe this should just be:  "VOLUME conf"
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121292308
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    --- End diff --
    
    From my understanding of the JIRA comments, the GID could be removed since useradd makes the group. And GID 50 already existed, anyway 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    Those images are created automatically from release tags (e.g. rel/nifi-1.2.0) on the source code repository.  Those tags are protected and immutable on the repository; once they are created they cannot be overwritten whatsoever.  It is this standard that prevents us from replacing the images.  As a project community, we have no permissions to directly interact with Apache Docker Hub account which is managed by the Infra team.  
    
    As mentioned, if a patch version of either those comes out, we can port these changes to that release branch as well.  If we were to break docker components out into their own repo, we could overwrite those tags on Docker Hub.  Unfortunately, until the source repo of the Dockerfile changes, those versions in Docker Hub are locked to the associated commits that generated them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    I understand the release tagging and automated build hooks of DockerHub, but I don't see why whoever has permission to push to DockerHub cannot manually overwrite the current "bloated" images. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r123647502
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,38 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
    +ARG GID=1000
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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
     
    -# Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $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
    -
    -RUN chown -R nifi:nifi $NIFI_HOME
    +USER nifi
     
    -# Web HTTP Port
    -EXPOSE 8080
    +# Download, validate, and expand Apache NiFi binary.
    +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
    --- End diff --
    
    The chown here shouldn't be necessary?  Since NIFI_BASE_DIR has already been chowned to the NIFI user, which we're using for the curl statement.  Is that right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    @taftster I updated the Maven version as well, and I believe it built successfully after updating the `pom.xml` version.
    
    Was there anything else needing to be addressed? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r127824242
  
    --- Diff: nifi-docker/dockermaven/Dockerfile ---
    @@ -16,32 +16,33 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     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 --
    
    But this causes the duplicate layer issue again.  Bit of a different environment as we are not able to add & chmod the files in the same sequence given the nature of the ADD command.  May just have to be a concession we make for the local environment.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r123647376
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,38 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
    +ARG GID=1000
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 \
    --- End diff --
    
    Is this 'mkdir' leftover from the previous pull request?  Specifically, didn't we say we'd address the exposed VOLUME directories in another PR?  It's not hurting anything, of course, but I don't think it was in the original Dockerfile either.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121296054
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    +    && mkdir -p $NIFI_HOME/conf/templates && chown -R nifi:nifi $NIFI_BASE_DIR
    +
    +USER nifi
     
     # Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $NIFI_BINARY_URL.sha256) *$NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz" | sha256sum -c - \
    +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
    +	&& rm $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    +    && chown -R nifi:nifi $NIFI_HOME
     
    -RUN chown -R nifi:nifi $NIFI_HOME
    +# Web HTTP Port & Remote Site-to-Site Ports
    +EXPOSE 8080 8181
     
    -# Web HTTP Port
    -EXPOSE 8080
    +WORKDIR $NIFI_HOME
     
    -# Remote Site-To-Site Port
    -EXPOSE 8181
    -
    -USER nifi
    +VOLUME conf/templates
     
    --- End diff --
    
    Can that be an extended discussion elsewhere? While I might agree, at least for nifi.properties, the primary goal of this PR was to cut down the image size.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121291104
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    --- End diff --
    
    Your groupadd command leaves off the "-g $GID" from the previous commit.  Since $GID is being specified and passed in from DockerBuild.sh, it's probably best that we continue to create the group with the specified $GID.  If it's a valid configuration option, it needs to be used as the group id here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by jimzucker <gi...@git.apache.org>.
Github user jimzucker commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    When can we get a 1.3.1 with this fix, happy to help if that is needed but the current image is terribly large.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by apiri <gi...@git.apache.org>.
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 <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    reviewing


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r127823749
  
    --- Diff: nifi-docker/dockermaven/Dockerfile ---
    @@ -16,32 +16,33 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     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 --
    
    Looks like the chown was an issue after user.  Moving USER below the chown seems to work appropriately.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121296995
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    +    && mkdir -p $NIFI_HOME/conf/templates && chown -R nifi:nifi $NIFI_BASE_DIR
    +
    +USER nifi
     
     # Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $NIFI_BINARY_URL.sha256) *$NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz" | sha256sum -c - \
    +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
    +	&& rm $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    +    && chown -R nifi:nifi $NIFI_HOME
     
    -RUN chown -R nifi:nifi $NIFI_HOME
    +# Web HTTP Port & Remote Site-to-Site Ports
    +EXPOSE 8080 8181
     
    -# Web HTTP Port
    -EXPOSE 8080
    +WORKDIR $NIFI_HOME
     
    -# Remote Site-To-Site Port
    -EXPOSE 8181
    -
    -USER nifi
    +VOLUME conf/templates
     
    --- End diff --
    
    Fine by me. No problem separating that as a separate concern.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r127817762
  
    --- Diff: nifi-docker/dockermaven/Dockerfile ---
    @@ -16,32 +16,33 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     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
    --- End diff --
    
    This needs a '\'
    
    Everything else looks pretty good and just verifying successful build.  If so, I can adjust this on merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    @apiri I understand that you cannot push code changes for a release < 1.4.0, but this isn't changing source code, only pushing a different Dockerfile to DockerHub. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    @cricket007 The Dockerfiles are part of the entire NiFi codebase.  There has been some discussion about breaking the Docker components into their own repository which would free us from this situation and allow us to release more frequently/independently.  However, in the current state, another release would be needed as the tagged release triggers Docker Hub to build.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    Is there anyway to re-publish the 1.2.0 and 1.3.0 images so that those aren't as large?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121297796
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    +    && mkdir -p $NIFI_HOME/conf/templates && chown -R nifi:nifi $NIFI_BASE_DIR
    +
    +USER nifi
     
     # Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $NIFI_BINARY_URL.sha256) *$NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz" | sha256sum -c - \
    +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
    +	&& rm $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    +    && chown -R nifi:nifi $NIFI_HOME
     
    -RUN chown -R nifi:nifi $NIFI_HOME
    +# Web HTTP Port & Remote Site-to-Site Ports
    +EXPOSE 8080 8181
     
    -# Web HTTP Port
    -EXPOSE 8080
    +WORKDIR $NIFI_HOME
     
    -# Remote Site-To-Site Port
    -EXPOSE 8181
    -
    -USER nifi
    +VOLUME conf/templates
     
    --- End diff --
    
    I've removed it from the latest commit. One can always mount the folder if needed. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121292352
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    --- End diff --
    
    I'm just saying, if we're going to remove $GID, we should remove it entirely.  But if we're going to support it (i.e. by having an option in the Dockerbuild.sh), then we should support it entirely.  Line 31 currently ignores $GID.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121292333
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    +    && mkdir -p $NIFI_HOME/conf/templates && chown -R nifi:nifi $NIFI_BASE_DIR
    +
    +USER nifi
     
     # Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $NIFI_BINARY_URL.sha256) *$NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz" | sha256sum -c - \
    +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 - \
    --- End diff --
    
    Ah ha!  OK then!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r123796605
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,38 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
    +ARG GID=1000
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 \
    --- End diff --
    
    The `conf/templates` directory is not part of the binary, so as a result, I don't think you can save templates as part of running the Docker container. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r123810933
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,38 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
    +ARG GID=1000
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 \
    --- End diff --
    
    OK, wow.  Yeah, that would be a problem.  Good catch!  Definitely need this then.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121292271
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    +    && mkdir -p $NIFI_HOME/conf/templates && chown -R nifi:nifi $NIFI_BASE_DIR
    +
    +USER nifi
     
     # Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $NIFI_BINARY_URL.sha256) *$NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz" | sha256sum -c - \
    +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 - \
    --- End diff --
    
    The mirrors don't include the sha 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by cricket007 <gi...@git.apache.org>.
Github user cricket007 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r123797661
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,38 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
    +ARG GID=1000
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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
     
    -# Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $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
    -
    -RUN chown -R nifi:nifi $NIFI_HOME
    +USER nifi
     
    -# Web HTTP Port
    -EXPOSE 8080
    +# Download, validate, and expand Apache NiFi binary.
    +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
    --- End diff --
    
    Shouldn't be necessary, no. Doesn't seem to be hurting anything, though. 
    I think I did it because I didn't trust the previous `chown -R` to hold after the `curl`, but since using `USER` beforehand, that does make it redundant. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    Changes to this Dockerfile should also be reciprocally to ../dockermaven/Dockerfile


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/1910


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1910: NIFI-4057 Docker Image is twice as large as necessa...

Posted by taftster <gi...@git.apache.org>.
Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1910#discussion_r121290876
  
    --- Diff: nifi-docker/dockerhub/Dockerfile ---
    @@ -16,37 +16,37 @@
     # under the License.
     #
     
    -FROM openjdk:8
    -MAINTAINER Apache NiFi <de...@nifi.apache.org>
    +FROM openjdk:8-jre
    +LABEL maintainer "Apache NiFi <de...@nifi.apache.org>"
     
     ARG UID=1000
    -ARG GID=50
     ARG NIFI_VERSION=1.4.0
    +ARG MIRROR=https://archive.apache.org/dist
     
    -ENV NIFI_BASE_DIR /opt/nifi
    -ENV NIFI_HOME $NIFI_BASE_DIR/nifi-$NIFI_VERSION
    -ENV NIFI_BINARY_URL https://archive.apache.org/dist/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
    +ENV NIFI_BASE_DIR /opt/nifi 
    +ENV NIFI_HOME=$NIFI_BASE_DIR/nifi-$NIFI_VERSION \
    +    NIFI_BINARY_URL=/nifi/$NIFI_VERSION/nifi-$NIFI_VERSION-bin.tar.gz
     
     # 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 nifi && useradd nifi --shell /bin/bash -u $UID -m -g nifi  \
    +    && mkdir -p $NIFI_HOME/conf/templates && chown -R nifi:nifi $NIFI_BASE_DIR
    +
    +USER nifi
     
     # Download, validate, and expand Apache NiFi binary.
    -RUN curl -fSL $NIFI_BINARY_URL -o $NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz \
    -	&& echo "$(curl $NIFI_BINARY_URL.sha256) *$NIFI_BASE_DIR/nifi-$NIFI_VERSION-bin.tar.gz" | sha256sum -c - \
    +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 - \
    --- End diff --
    
    Shouldn't this inner sha256 curl also use $MIRROR?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1910: NIFI-4057 Docker Image is twice as large as necessary

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi/pull/1910
  
    @cricket007 we cannot given ASF guidelines unless we do another release.  If there is a patch release that is created, we can certainly feed this in as part of that effort.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---