Repository: nifi Updated Branches: refs/heads/master a794166d2 -> c8f437e83
NIFI-3260 Official Docker Image Added baseline Docker image for NiFi This closes #1372. Signed-off-by: Aldrin Piri <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/c8f437e8 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/c8f437e8 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/c8f437e8 Branch: refs/heads/master Commit: c8f437e83315882e3c9204ec8d2f46fc7f3f8f06 Parents: a794166 Author: Jeremy Dyer <[email protected]> Authored: Thu Dec 29 15:36:04 2016 -0500 Committer: Aldrin Piri <[email protected]> Committed: Tue Jan 10 13:24:33 2017 -0500 ---------------------------------------------------------------------- nifi-docker/README.md | 33 +++++++++++++ nifi-docker/dockerhub/.dockerignore | 19 ++++++++ nifi-docker/dockerhub/DockerBuild.sh | 31 +++++++++++++ nifi-docker/dockerhub/DockerImage.txt | 16 +++++++ nifi-docker/dockerhub/DockerRun.sh | 19 ++++++++ nifi-docker/dockerhub/Dockerfile | 52 +++++++++++++++++++++ nifi-docker/dockermaven/Dockerfile | 47 +++++++++++++++++++ nifi-docker/pom.xml | 74 ++++++++++++++++++++++++++++++ pom.xml | 2 +- 9 files changed, 292 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/README.md ---------------------------------------------------------------------- diff --git a/nifi-docker/README.md b/nifi-docker/README.md new file mode 100644 index 0000000..c73cd3c --- /dev/null +++ b/nifi-docker/README.md @@ -0,0 +1,33 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +Apache NiFi supports powerful and scalable directed graphs of data routing, transformation, and system mediation logic. Some of the high-level capabilities and objectives of Apache NiFi include: + +* Web-based user interface + * Seamless experience between design, control, feedback, and monitoring +* Highly configurable + * Loss tolerant vs guaranteed delivery + * Low latency vs high throughput + * Dynamic prioritization + * Flow can be modified at runtime + * Back pressure +* Data Provenance + * Track dataflow from beginning to end +* Designed for extension + * Build your own processors and more + * Enables rapid development and effective testing +* Secure + * SSL, SSH, HTTPS, encrypted content, etc... + * Multi-tenant authorization and internal authorization/policy management http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/dockerhub/.dockerignore ---------------------------------------------------------------------- diff --git a/nifi-docker/dockerhub/.dockerignore b/nifi-docker/dockerhub/.dockerignore new file mode 100644 index 0000000..30a2650 --- /dev/null +++ b/nifi-docker/dockerhub/.dockerignore @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Place files you want to exclude from the docker build here similar to .gitignore https://docs.docker.com/engine/reference/builder/#dockerignore-file +DockerBuild.sh +DockerRun.sh +DockerImage.txt \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/dockerhub/DockerBuild.sh ---------------------------------------------------------------------- diff --git a/nifi-docker/dockerhub/DockerBuild.sh b/nifi-docker/dockerhub/DockerBuild.sh new file mode 100755 index 0000000..29afc7a --- /dev/null +++ b/nifi-docker/dockerhub/DockerBuild.sh @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/bin/bash + +DOCKER_UID=1000 +if [ -n "$1" ]; then + DOCKER_UID="$1" +fi + +DOCKER_GID=50 +if [ -n "$2" ]; then + DOCKER_GID="$2" +fi + +DOCKER_IMAGE="$(egrep -v '(^#|^\s*$|^\s*\t*#)' DockerImage.txt)" +NIFI_IMAGE_VERSION="$(echo $DOCKER_IMAGE | cut -d : -f 2)" +echo "Building NiFi Image: '$DOCKER_IMAGE' Version: $NIFI_IMAGE_VERSION" +docker build --build-arg UID="$DOCKER_UID" --build-arg GID="$DOCKER_GID" --build-arg NIFI_VERSION="$NIFI_IMAGE_VERSION" -t $DOCKER_IMAGE . \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/dockerhub/DockerImage.txt ---------------------------------------------------------------------- diff --git a/nifi-docker/dockerhub/DockerImage.txt b/nifi-docker/dockerhub/DockerImage.txt new file mode 100644 index 0000000..f35085c --- /dev/null +++ b/nifi-docker/dockerhub/DockerImage.txt @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apachenifi:1.1.1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/dockerhub/DockerRun.sh ---------------------------------------------------------------------- diff --git a/nifi-docker/dockerhub/DockerRun.sh b/nifi-docker/dockerhub/DockerRun.sh new file mode 100755 index 0000000..d25551d --- /dev/null +++ b/nifi-docker/dockerhub/DockerRun.sh @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/bin/bash +DOCKER_IMAGE="$(egrep -v '(^#|^\s*$|^\s*\t*#)' DockerImage.txt)" +echo "Running Docker Image: $DOCKER_IMAGE" +docker run -it -d -p 8080:8080 -p 8181:8181 $DOCKER_IMAGE \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/dockerhub/Dockerfile ---------------------------------------------------------------------- diff --git a/nifi-docker/dockerhub/Dockerfile b/nifi-docker/dockerhub/Dockerfile new file mode 100644 index 0000000..ae273cc --- /dev/null +++ b/nifi-docker/dockerhub/Dockerfile @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +FROM java:8 +MAINTAINER Apache NiFi <[email protected]> + +ARG UID +ARG GID +ARG NIFI_VERSION + +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 + +# 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 + +# 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 + +# Web HTTP Port +EXPOSE 8080 + +# Remote Site-To-Site Port +EXPOSE 8181 + +USER nifi + +# Startup NiFi +CMD $NIFI_HOME/bin/nifi.sh run http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/dockermaven/Dockerfile ---------------------------------------------------------------------- diff --git a/nifi-docker/dockermaven/Dockerfile b/nifi-docker/dockermaven/Dockerfile new file mode 100644 index 0000000..32bb638 --- /dev/null +++ b/nifi-docker/dockermaven/Dockerfile @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +FROM java:8 +MAINTAINER Apache NiFi <[email protected]> + +ARG UID +ARG GID +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 + +ADD $NIFI_BINARY $NIFI_BASE_DIR +RUN chown -R nifi:nifi $NIFI_HOME + +# Web HTTP Port +EXPOSE 8080 + +# Remote Site-To-Site Port +EXPOSE 8181 + +USER nifi + +# Startup NiFi +CMD $NIFI_HOME/bin/nifi.sh run http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/nifi-docker/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-docker/pom.xml b/nifi-docker/pom.xml new file mode 100644 index 0000000..0b3ca7c --- /dev/null +++ b/nifi-docker/pom.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor +license agreements. See the NOTICE file distributed with this work for additional +information regarding copyright ownership. The ASF licenses this file to +You under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of +the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required +by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.nifi</groupId> + <artifactId>nifi</artifactId> + <version>1.2.0-SNAPSHOT</version> + </parent> + + <groupId>org.apache.nifi</groupId> + <artifactId>nifi-docker</artifactId> + <version>1.2.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <properties> + <nifi.version>1.2.0-SNAPSHOT</nifi.version> + </properties> + + <profiles> + <!-- Profile for building official Docker images. Not bound to build phases since that would require anyone build to have the Docker engine installed on their machine --> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.4.13</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + </executions> + <configuration> + <imageName>apachenifi</imageName> + <dockerDirectory>${project.basedir}/dockermaven</dockerDirectory> + <imageTags> + <imageTag>${nifi.version}</imageTag> + </imageTags> + <buildArgs> + <UID>1000</UID> + <GID>1000</GID> + <NIFI_VERSION>${nifi.version}</NIFI_VERSION> + <NIFI_BINARY>nifi-${nifi.version}-bin.tar.gz</NIFI_BINARY> + </buildArgs> + <resources> + <resource> + <targetPath>/</targetPath> + <directory>${project.basedir}/../nifi-assembly/target</directory> + <include>nifi-${nifi.version}-bin.tar.gz</include> + </resource> + </resources> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> http://git-wip-us.apache.org/repos/asf/nifi/blob/c8f437e8/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 87eca5e..59a6e14 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,7 @@ language governing permissions and limitations under the License. --> <module>nifi-maven-archetypes</module> <module>nifi-external</module> <module>nifi-toolkit</module> + <module>nifi-docker</module> </modules> <url>http://nifi.apache.org</url> <organization> @@ -106,7 +107,6 @@ language governing permissions and limitations under the License. --> <storm.version>1.0.1</storm.version> </properties> - <repositories> <repository> <id>central</id>
