-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-ghidra-dev
40 lines (32 loc) · 1.45 KB
/
Dockerfile-ghidra-dev
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
FROM openjdk:11-slim
ARG GHIDRA_VERSION=9.0_PUBLIC_20190228
ARG GHIDRA_SHA256=3b65d29024b9decdbb1148b12fe87bcb7f3a6a56ff38475f5dc9dd1cfc7fd6b2
RUN useradd -m ghidra && \
mkdir -p /srv/repositories && \
chown -R ghidra: /srv/repositories && \
update-alternatives --install "/usr/bin/java" "java" "/usr/local/openjdk-11/bin/java" 0 && \
update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/openjdk-11/bin/javac" 0
WORKDIR /opt
RUN apt-get update && apt-get install -y unzip wget gettext-base patch sudo ed libfreetype6 libfontconfig1 fontconfig-config libexpat1 fonts-dejavu-core libpng16-16 && \
wget -q -O ghidra.zip https://ghidra-sre.org/ghidra_${GHIDRA_VERSION}.zip && \
echo "${GHIDRA_SHA256} *ghidra.zip" | sha256sum -c && \
unzip ghidra.zip && \
rm ghidra.zip && \
ln -s ghidra* ghidra && \
cd ghidra && \
rm -rf docs && \
cd .. && chown -R ghidra: ghidra*
VOLUME /srv/repositories
WORKDIR /opt/ghidra
ENV ghidra_home=/opt/ghidra
COPY --chown=ghidra:ghidra ./ghidra/server /opt/ghidra/server
RUN ./support/analyzeHeadless . empty -postScript ./server/BuildSingleGhidraJar.java /opt/ghidra/ghidra.jar -noanalysis -deleteProject && chown ghidra ghidra.jar
RUN server/svrInstall
EXPOSE 13100 13101 13102
RUN mkdir /var/sessions && chown ghidra /var/sessions
RUN mkdir /opt/ghidra/bridge && chown ghidra /opt/ghidra/bridge
USER ghidra
# inherit perms
VOLUME /var/sessions
VOLUME /opt/ghidra/bridge
CMD server/dev.sh