You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by je...@apache.org on 2017/03/20 18:17:05 UTC
[1/2] nifi-minifi git commit: MINIFI-240 - Docker image for MiNiFi
Java
Repository: nifi-minifi
Updated Branches:
refs/heads/master 52998f234 -> f0211edab
MINIFI-240 - Docker image for MiNiFi Java
Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi/commit/3694d11f
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi/tree/3694d11f
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi/diff/3694d11f
Branch: refs/heads/master
Commit: 3694d11fc085fe7bb7f92d4f0d42b52e8e0d5b08
Parents: 52998f2
Author: Bryan Rosander <br...@apache.org>
Authored: Wed Mar 15 13:21:58 2017 -0400
Committer: Bryan Rosander <br...@apache.org>
Committed: Wed Mar 15 14:35:30 2017 -0400
----------------------------------------------------------------------
minifi-docker/README.md | 27 ++++++++++
minifi-docker/dockerhub/.dockerignore | 19 ++++++++
minifi-docker/dockerhub/DockerBuild.sh | 31 ++++++++++++
minifi-docker/dockerhub/DockerImage.txt | 16 ++++++
minifi-docker/dockerhub/DockerRun.sh | 19 ++++++++
minifi-docker/dockerhub/Dockerfile | 46 ++++++++++++++++++
minifi-docker/dockermaven/Dockerfile | 41 ++++++++++++++++
minifi-docker/pom.xml | 73 ++++++++++++++++++++++++++++
pom.xml | 1 +
9 files changed, 273 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/minifi-docker/README.md
----------------------------------------------------------------------
diff --git a/minifi-docker/README.md b/minifi-docker/README.md
new file mode 100644
index 0000000..1042263
--- /dev/null
+++ b/minifi-docker/README.md
@@ -0,0 +1,27 @@
+<!--
+ 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 MiNiFi
+-------------
+A subproject of Apache NiFi and a complementary data collection approach that supplements the core tenets of NiFi in dataflow management, focusing on the collection of data at the source of its creation.
+
+Specific goals for the initial thrust of the MiNiFi effort comprise:
+
+* small and lightweight footprint,
+* central management of agents,
+* generation of data provenance, and
+* integration with NiFi for follow-on dataflow management and full chain of custody of information.
+
+Perspectives of the role of MiNiFi should be from the perspective of the agent acting immediately at, or directly adjacent to, source sensors, systems, or servers.
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/minifi-docker/dockerhub/.dockerignore
----------------------------------------------------------------------
diff --git a/minifi-docker/dockerhub/.dockerignore b/minifi-docker/dockerhub/.dockerignore
new file mode 100644
index 0000000..30a2650
--- /dev/null
+++ b/minifi-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-minifi/blob/3694d11f/minifi-docker/dockerhub/DockerBuild.sh
----------------------------------------------------------------------
diff --git a/minifi-docker/dockerhub/DockerBuild.sh b/minifi-docker/dockerhub/DockerBuild.sh
new file mode 100755
index 0000000..efadfa0
--- /dev/null
+++ b/minifi-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)"
+MINIFI_IMAGE_VERSION="$(echo $DOCKER_IMAGE | cut -d : -f 2)"
+echo "Building MiNiFi Image: '$DOCKER_IMAGE' Version: $MINIFI_IMAGE_VERSION"
+docker build --build-arg UID="$DOCKER_UID" --build-arg GID="$DOCKER_GID" --build-arg MINIFI_VERSION="$MINIFI_IMAGE_VERSION" -t $DOCKER_IMAGE .
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/minifi-docker/dockerhub/DockerImage.txt
----------------------------------------------------------------------
diff --git a/minifi-docker/dockerhub/DockerImage.txt b/minifi-docker/dockerhub/DockerImage.txt
new file mode 100644
index 0000000..d3d8c55
--- /dev/null
+++ b/minifi-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.
+
+apacheminifi:0.1.0
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/minifi-docker/dockerhub/DockerRun.sh
----------------------------------------------------------------------
diff --git a/minifi-docker/dockerhub/DockerRun.sh b/minifi-docker/dockerhub/DockerRun.sh
new file mode 100755
index 0000000..9436848
--- /dev/null
+++ b/minifi-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 $DOCKER_IMAGE
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/minifi-docker/dockerhub/Dockerfile
----------------------------------------------------------------------
diff --git a/minifi-docker/dockerhub/Dockerfile b/minifi-docker/dockerhub/Dockerfile
new file mode 100644
index 0000000..059310a
--- /dev/null
+++ b/minifi-docker/dockerhub/Dockerfile
@@ -0,0 +1,46 @@
+# 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 openjdk:8
+MAINTAINER Apache MiNiFi <de...@nifi.apache.org>
+
+ARG UID=1000
+ARG GID=50
+ARG MINIFI_VERSION=0.2.0
+
+ENV MINIFI_BASE_DIR /opt/minifi
+ENV MINIFI_HOME $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION
+ENV MINIFI_BINARY_URL https://archive.apache.org/dist/minifi/$MINIFI_VERSION/minifi-$MINIFI_VERSION-bin.tar.gz
+
+# Setup MiNiFi user
+RUN groupadd -g $GID minifi || groupmod -n minifi `getent group $GID | cut -d: -f1`
+RUN useradd --shell /bin/bash -u $UID -g $GID -m minifi
+RUN mkdir -p $MINIFI_HOME
+
+# Download, validate, and expand Apache MiNiFi binary.
+RUN curl -fSL $MINIFI_BINARY_URL -o $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION-bin.tar.gz \
+ && echo "$(curl $MINIFI_BINARY_URL.sha256) *$MINIFI_BASE_DIR/minifi-$MINIFI_VERSION-bin.tar.gz" | sha256sum -c - \
+ && tar -xvzf $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION-bin.tar.gz -C $MINIFI_BASE_DIR \
+ && rm $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION-bin.tar.gz
+
+RUN chown -R minifi:minifi $MINIFI_HOME
+
+USER minifi
+
+# Startup MiNiFi
+CMD $MINIFI_HOME/bin/minifi.sh run
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/minifi-docker/dockermaven/Dockerfile
----------------------------------------------------------------------
diff --git a/minifi-docker/dockermaven/Dockerfile b/minifi-docker/dockermaven/Dockerfile
new file mode 100644
index 0000000..602d985
--- /dev/null
+++ b/minifi-docker/dockermaven/Dockerfile
@@ -0,0 +1,41 @@
+# 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 openjdk:8
+MAINTAINER Apache MiNiFi <de...@nifi.apache.org>
+
+ARG UID=1000
+ARG GID=50
+ARG MINIFI_VERSION
+ARG MINIFI_BINARY
+
+ENV MINIFI_BASE_DIR /opt/minifi
+ENV MINIFI_HOME $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION
+
+# Setup MiNiFi user
+RUN groupadd -g $GID minifi || groupmod -n minifi `getent group $GID | cut -d: -f1`
+RUN useradd --shell /bin/bash -u $UID -g $GID -m minifi
+RUN mkdir -p $MINIFI_HOME
+
+ADD $MINIFI_BINARY $MINIFI_BASE_DIR
+RUN chown -R minifi:minifi $MINIFI_HOME
+
+USER minifi
+
+# Startup MiNiFi
+CMD $MINIFI_HOME/bin/minifi.sh run
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/minifi-docker/pom.xml
----------------------------------------------------------------------
diff --git a/minifi-docker/pom.xml b/minifi-docker/pom.xml
new file mode 100644
index 0000000..997d24a
--- /dev/null
+++ b/minifi-docker/pom.xml
@@ -0,0 +1,73 @@
+<?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.minifi</groupId>
+ <artifactId>minifi</artifactId>
+ <version>0.2.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.nifi.minifi</groupId>
+ <artifactId>minifi-docker</artifactId>
+ <version>0.2.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <minifi.version>${project.version}</minifi.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>apacheminifi</imageName>
+ <dockerDirectory>${project.basedir}/dockermaven</dockerDirectory>
+ <imageTags>
+ <imageTag>${minifi.version}</imageTag>
+ </imageTags>
+ <buildArgs>
+ <UID>1000</UID>
+ <GID>1000</GID>
+ <MINIFI_VERSION>${minifi.version}</MINIFI_VERSION>
+ <MINIFI_BINARY>minifi-${minifi.version}-bin.tar.gz</MINIFI_BINARY>
+ </buildArgs>
+ <resources>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.basedir}/../minifi-assembly/target</directory>
+ <include>minifi-${minifi.version}-bin.tar.gz</include>
+ </resource>
+ </resources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/3694d11f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6948836..3727ce4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,6 +38,7 @@ limitations under the License.
<module>minifi-docs</module>
<module>minifi-assembly</module>
<module>minifi-toolkit</module>
+ <module>minifi-docker</module>
</modules>
<url>http://nifi.apache.org/minifi</url>
[2/2] nifi-minifi git commit: MINIFI-240 - Fixing url in docker hub
Dockerfile
Posted by je...@apache.org.
MINIFI-240 - Fixing url in docker hub Dockerfile
This close #74
Signed-off-by: Jeremy Dyer <je...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi/commit/f0211eda
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi/tree/f0211eda
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi/diff/f0211eda
Branch: refs/heads/master
Commit: f0211edabba08a0fc84f9f196abfbe2f73b9e3c0
Parents: 3694d11
Author: Bryan Rosander <br...@apache.org>
Authored: Mon Mar 20 11:59:08 2017 -0400
Committer: Jeremy Dyer <je...@apache.org>
Committed: Mon Mar 20 14:13:50 2017 -0400
----------------------------------------------------------------------
minifi-docker/dockerhub/Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f0211eda/minifi-docker/dockerhub/Dockerfile
----------------------------------------------------------------------
diff --git a/minifi-docker/dockerhub/Dockerfile b/minifi-docker/dockerhub/Dockerfile
index 059310a..b66cfae 100644
--- a/minifi-docker/dockerhub/Dockerfile
+++ b/minifi-docker/dockerhub/Dockerfile
@@ -25,7 +25,7 @@ ARG MINIFI_VERSION=0.2.0
ENV MINIFI_BASE_DIR /opt/minifi
ENV MINIFI_HOME $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION
-ENV MINIFI_BINARY_URL https://archive.apache.org/dist/minifi/$MINIFI_VERSION/minifi-$MINIFI_VERSION-bin.tar.gz
+ENV MINIFI_BINARY_URL https://archive.apache.org/dist/nifi/minifi/$MINIFI_VERSION/minifi-$MINIFI_VERSION-bin.tar.gz
# Setup MiNiFi user
RUN groupadd -g $GID minifi || groupmod -n minifi `getent group $GID | cut -d: -f1`