Skip to content

Commit

Permalink
Added central_node Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
arisjr committed Jul 8, 2023
1 parent ae3e97e commit 60513d4
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Dockerfile.transcription_central_node
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM ubuntu:22.04

ARG IPED_RELEASE_VERSION=4.1.3 SNAPSHOT=false SNAPSHOT_WORKFLOW_ID=5073165507 PKGTMPDIR=/tmp/pkgs

ENV TZ=Brazil/East DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 LC_ALL=C.UTF-8 \
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

RUN mkdir -p ${PKGTMPDIR} && cd ${PKGTMPDIR} \
&& apt-get update && apt-get install -y curl \
&& apt-get dist-upgrade -y \
&& apt-get install -y \
openjdk-11-jre-headless \
&& echo "#####################################" \
&& echo "Cleaning UP the container " \
&& echo "#####################################" \
&& apt-get remove -y python3-pip \
&& apt-get autoremove -y \
&& rm -rf /root/.cache/pip && rm -rf ${PKGTMPDIR}/* && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN --mount=type=secret,id=ACTION_GH_TOKEN export ACTION_GH_TOKEN=$(cat /run/secrets/ACTION_GH_TOKEN) \
&& mkdir -p /opt/IPED/ && cd /opt/IPED/ \
&& if [ "${SNAPSHOT}" = "true" ]; \
then \
echo "#####################################" && \
echo "Installing IPED from SNAPSHOT " && \
echo "#####################################" && \
echo -n "Getting snapshot with run ID ${SNAPSHOT_WORKFLOW_ID}..." && \
snapshotURL=$(curl -s -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${ACTION_GH_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/sepinf-inc/IPED/actions/artifacts | \
jq --arg workflow_id $SNAPSHOT_WORKFLOW_ID -c '.artifacts[] | select(.workflow_run.id|tostring == $workflow_id) | .archive_download_url' | \
tr -d '\"') && \
echo "Downloading ${snapshotURL}..." && \
curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${ACTION_GH_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" --output ${PKGTMPDIR}/iped.zip ${snapshotURL} && \
unzip -p ${PKGTMPDIR}/iped.zip | tar -xvz --strip-components=1; \
else \
echo "#####################################" && \
echo "Installing IPED from RELEASE " && \
echo "#####################################" && \
curl -L https://github.com/sepinf-inc/IPED/releases/download/$IPED_RELEASE_VERSION/IPED-${IPED_RELEASE_VERSION}_and_plugins.zip --output ${PKGTMPDIR}/iped.zip && \
unzip ${PKGTMPDIR}/iped.zip iped*/lib/iped-engine-*.jar ;\
fi \
&& echo "Creating IPED simbolic links..." \
&& ls | grep "iped-" | xargs -i sh -c 'ln -s "{}" iped' \
&& cd /opt/IPED/iped/lib \
&& ls | grep "iped-engine-" | xargs -i sh -c 'ln -s "{}" iped-engine.jar' \
&& echo "#####################################" \
&& echo "Cleaning UP the container " \
&& echo "#####################################" \
&& rm -rf ${PKGTMPDIR}

WORKDIR /opt/IPED/iped
CMD ["/bin/bash"]

0 comments on commit 60513d4

Please sign in to comment.