You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2020/05/31 00:36:27 UTC

[nifi-minifi] branch master updated: MINIFI-524 Added ARM64 Docker for MiNiFi

This is an automated email from the ASF dual-hosted git repository.

aldrin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 70d2e35  MINIFI-524 Added ARM64 Docker for MiNiFi
70d2e35 is described below

commit 70d2e35758090728eb852817fc4c5f044206c2e5
Author: Data Philosopher <or...@gmail.com>
AuthorDate: Sun Feb 2 01:46:02 2020 +0000

    MINIFI-524 Added ARM64 Docker for MiNiFi
    
    This closes #184.
    
    Signed-off-by: Aldrin Piri <al...@apache.org>
---
 minifi-docker/dockerhub_ARM64/DockerBuild.sh  | 31 +++++++++++++++
 minifi-docker/dockerhub_ARM64/DockerImage.txt | 16 ++++++++
 minifi-docker/dockerhub_ARM64/DockerRun.sh    | 19 ++++++++++
 minifi-docker/dockerhub_ARM64/Dockerfile      | 54 +++++++++++++++++++++++++++
 minifi-docker/dockerhub_ARM64/sh/start.sh     | 26 +++++++++++++
 5 files changed, 146 insertions(+)

diff --git a/minifi-docker/dockerhub_ARM64/DockerBuild.sh b/minifi-docker/dockerhub_ARM64/DockerBuild.sh
new file mode 100755
index 0000000..69d0459
--- /dev/null
+++ b/minifi-docker/dockerhub_ARM64/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/sh
+
+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 .
diff --git a/minifi-docker/dockerhub_ARM64/DockerImage.txt b/minifi-docker/dockerhub_ARM64/DockerImage.txt
new file mode 100644
index 0000000..6d1141d
--- /dev/null
+++ b/minifi-docker/dockerhub_ARM64/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.
+
+apache/nifi-minifi:0.5.0
diff --git a/minifi-docker/dockerhub_ARM64/DockerRun.sh b/minifi-docker/dockerhub_ARM64/DockerRun.sh
new file mode 100755
index 0000000..1f5b3f0
--- /dev/null
+++ b/minifi-docker/dockerhub_ARM64/DockerRun.sh
@@ -0,0 +1,19 @@
+#!/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.
+# 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="$(egrep -v '(^#|^\s*$|^\s*\t*#)' DockerImage.txt)"
+echo "Running Docker Image: $DOCKER_IMAGE"
+docker run -it -d $DOCKER_IMAGE
\ No newline at end of file
diff --git a/minifi-docker/dockerhub_ARM64/Dockerfile b/minifi-docker/dockerhub_ARM64/Dockerfile
new file mode 100644
index 0000000..83eb8a1
--- /dev/null
+++ b/minifi-docker/dockerhub_ARM64/Dockerfile
@@ -0,0 +1,54 @@
+# 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 arm64v8/openjdk:8
+MAINTAINER Apache MiNiFi <de...@nifi.apache.org>
+
+ARG UID=1000
+ARG GID=1000
+ARG MINIFI_VERSION=0.5.0
+
+ENV MINIFI_BASE_DIR /opt/minifi
+ENV MINIFI_HOME $MINIFI_BASE_DIR/minifi-current
+ENV MINIFI_BINARY_URL https://archive.apache.org/dist/nifi/minifi/$MINIFI_VERSION/minifi-$MINIFI_VERSION-bin.tar.gz
+
+# Setup MiNiFi user
+RUN addgroup --gid $GID minifi || groupmod -n minifi `getent group $GID | cut -d: -f1`
+RUN useradd -r -g minifi minifi
+#RUN usermod -a minifi minifi
+RUN mkdir -p $MINIFI_BASE_DIR
+
+#RUN apk --no-cache add curl
+RUN apt-get install 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 - \
+	&& 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 \
+	&& ln -s $MINIFI_BASE_DIR/minifi-$MINIFI_VERSION $MINIFI_HOME
+
+RUN echo $MINIFI_BASE_DIR/minifi-current
+
+RUN chown -R -L minifi:minifi $MINIFI_HOME
+
+USER minifi
+
+# Startup MiNiFi
+CMD ${MINIFI_BASE_DIR}/scripts/start.sh
diff --git a/minifi-docker/dockerhub_ARM64/sh/start.sh b/minifi-docker/dockerhub_ARM64/sh/start.sh
new file mode 100755
index 0000000..f1f19f9
--- /dev/null
+++ b/minifi-docker/dockerhub_ARM64/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