-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.transcriptor_central_node
55 lines (50 loc) · 2.94 KB
/
Dockerfile.transcriptor_central_node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM ubuntu:22.04
ARG SNAPSHOT=true IPED_RELEASE_VERSION=4.2 SNAPSHOT_WORKFLOW_ID=8243028270 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 \
unzip sudo jq patch \
&& 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"]