MINIFI-441 Update versions to reflect next release.
Adding tailing of the minifi process in the Dockerfile and updating documentation on how to make use of the Docker image.
This closes #130.
Signed-off-by: Kevin Doran <kdoran@apache.org>
diff --git a/minifi-docker/README.md b/minifi-docker/README.md
index 1042263..48bf056 100644
--- a/minifi-docker/README.md
+++ b/minifi-docker/README.md
@@ -13,7 +13,7 @@
limitations under the License.
-->
-Apache MiNiFi
+Apache NiFi - 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.
@@ -24,4 +24,4 @@
* 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.
+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.
\ No newline at end of file
diff --git a/minifi-docker/dockerhub/DockerImage.txt b/minifi-docker/dockerhub/DockerImage.txt
index 0f031c9..6d1141d 100644
--- a/minifi-docker/dockerhub/DockerImage.txt
+++ b/minifi-docker/dockerhub/DockerImage.txt
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-apacheminifi:0.2.0
+apache/nifi-minifi:0.5.0
diff --git a/minifi-docker/dockerhub/DockerRun.sh b/minifi-docker/dockerhub/DockerRun.sh
index a491927..1f5b3f0 100755
--- a/minifi-docker/dockerhub/DockerRun.sh
+++ b/minifi-docker/dockerhub/DockerRun.sh
@@ -1,3 +1,4 @@
+#!/bin/sh
# 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.
@@ -13,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#!/bin/sh
DOCKER_IMAGE="$(egrep -v '(^#|^\s*$|^\s*\t*#)' DockerImage.txt)"
echo "Running Docker Image: $DOCKER_IMAGE"
-docker run -it -d $DOCKER_IMAGE
+docker run -it -d $DOCKER_IMAGE
\ No newline at end of file
diff --git a/minifi-docker/dockerhub/Dockerfile b/minifi-docker/dockerhub/Dockerfile
index 8989364..484a2c7 100644
--- a/minifi-docker/dockerhub/Dockerfile
+++ b/minifi-docker/dockerhub/Dockerfile
@@ -21,7 +21,7 @@
ARG UID=1000
ARG GID=1000
-ARG MINIFI_VERSION=0.2.0
+ARG MINIFI_VERSION=0.5.0
ENV MINIFI_BASE_DIR /opt/minifi
ENV MINIFI_HOME $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION
@@ -34,6 +34,8 @@
RUN apk --no-cache add curl
+ADD sh/ ${MINIFI_BASE_DIR}/scripts/
+
# 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 - \
@@ -45,4 +47,4 @@
USER minifi
# Startup MiNiFi
-CMD $MINIFI_HOME/bin/minifi.sh run
+CMD ${MINIFI_BASE_DIR}/scripts/start.sh
diff --git a/minifi-docker/dockerhub/README.md b/minifi-docker/dockerhub/README.md
new file mode 100644
index 0000000..44495e5
--- /dev/null
+++ b/minifi-docker/dockerhub/README.md
@@ -0,0 +1,67 @@
+<!--
+ 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.
+-->
+# Docker Image Quickstart
+
+
+## Building
+The Docker image can be built using the following command:
+
+ docker build -t apache/nifi-minifi:latest .
+
+This build will result in an image tagged apache/nifi:latest
+
+ # user @ puter in ~/Development/code/apache/nifi-minifi/minifi-docker/dockerhub
+ $ docker images
+ REPOSITORY TAG IMAGE ID CREATED SIZE
+ apache/nifi-minifi latest f0f564eed149 A long, long time ago 226MB
+
+**Note**: The default version of NiFi specified by the Dockerfile is typically that of one that is unreleased if working from source.
+To build an image for a prior released version, one can override the `NIFI_VERSION` build-arg with the following command:
+
+ docker build --build-arg=MINIFI_VERSION={Desired MiNiFi Version} -t apache/nifi-minifi:latest .
+
+## Running a container
+
+### Supplying configuration to a container
+The primary means by which a MiNiFi instance is configured is via the `config.yml` or the `bootstrap.conf`.
+
+This can be accomplished through:
+ * the use of volumes, and
+ * overlaying the base image
+
+#### Using volumes to provide configuration
+The following example shows the usage of two volumes to provide both a `config.yml` and a `bootstrap.conf` to the container instance. This makes use of configuration files on the host and maps them to be used by the MiNiFi instance. This is helpful in scenarios where a single image is used for a variety of configurations.
+
+ docker run -d \
+ -v ~/minifi-conf/config.yml:/opt/minifi/minifi-0.5.0/conf/config.yml \
+ -v ~/minifi-conf/bootstrap.conf:/opt/minifi/minifi-0.5.0/conf/bootstrap.conf \
+ apache/nifi-minifi:0.5.0
+
+#### Using volumes to provide configuration
+Alternatively, it is possible to create a custom image inheriting from the published image. Creating a `Dockerfile` extending from the Apache NiFi MiNiFi base image allows users to overlay the configuration permanently into a newly built and custom image. A simple example follows:
+
+ FROM apache/nifi-minifi
+
+ ADD config.yml /opt/minifi/minifi-0.5.0/conf/config.yml
+ ADD bootstrap.conf /opt/minifi/minifi-0.5.0/conf/bootstrap.conf
+
+Building this `Dockerfile` will result in a custom image with the specified configuration files incorporated into the new image. This is best for applications where configuration is well defined and relatively static.
+
+For more information, please consult [Dockerfile Reference: FROM](https://docs.docker.com/engine/reference/builder/#from)
+
+
+
diff --git a/minifi-docker/dockerhub/sh/start.sh b/minifi-docker/dockerhub/sh/start.sh
new file mode 100755
index 0000000..f1f19f9
--- /dev/null
+++ b/minifi-docker/dockerhub/sh/start.sh
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+
+# 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.
+
+# Continuously provide logs so that 'docker logs' can produce them
+tail -F "${MINIFI_HOME}/logs/minifi-app.log" &
+"${MINIFI_HOME}/bin/minifi.sh" run &
+minifi_pid="$!"
+
+trap "echo Received trapped signal, beginning shutdown...;" KILL TERM HUP INT EXIT;
+
+echo MiNiFi running with PID ${minifi_pid}.
+wait ${minifi_pid}
\ No newline at end of file