Skip to content

Instantly share code, notes, and snippets.

@aug2uag
Created July 8, 2020 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aug2uag/626f9b277b403d8d742312dde87d74b0 to your computer and use it in GitHub Desktop.
Save aug2uag/626f9b277b403d8d742312dde87d74b0 to your computer and use it in GitHub Desktop.
Ghidra on radare2 Dockerfile with Python binding to r2pipe
# r2-ghidra-docker
# ================
#
# Requires 2.5GB of free disk space
#
# Using debian 9 as base image.
FROM debian:9
# Label base
LABEL r2docker latest
# Radare version
ARG R2_VERSION=master
# R2pipe python version
ARG R2_PIPE_PY_VERSION=0.8.9
# R2pipe node version
ARG R2_PIPE_NPM_VERSION=2.3.2
ENV R2_VERSION ${R2_VERSION}
ENV R2_PIPE_PY_VERSION ${R2_PIPE_PY_VERSION}
ENV R2_PIPE_NPM_VERSION ${R2_PIPE_NPM_VERSION}
RUN echo -e "Building versions:\n\
R2_VERSION=$R2_VERSION\n\
R2_PIPE_PY_VERSION=${R2_PIPE_PY_VERSION}\n\
R2_PIPE_NPM_VERSION=${R2_PIPE_NPM_VERSION}"
# Build radare2 in a volume to minimize space used by build
VOLUME ["/mnt"]
# Install all build dependencies
# Install bindings
# Build and install radare2 on master branch
# Remove all build dependencies
# Cleanup
RUN DEBIAN_FRONTEND=noninteractive dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y \
curl \
gcc \
git \
bison \
pkg-config \
make \
glib-2.0 \
libc6:i386 \
libncurses5:i386 \
libstdc++6:i386 \
gnupg2 \
cmake \
flex \
sudo \
python-pip && \
pip install r2pipe=="$R2_PIPE_PY_VERSION" && \
cd /mnt && \
git clone -b "$R2_VERSION" -q --depth 1 https://github.com/radare/radare2.git && \
cd radare2 && \
./sys/install.sh && \
./sys/user.sh && \
r2pm init && \
r2pm update && \
r2pm -i r2ghidra-dec && \
r2pm -i r2api-python && \
r2pm -i r2pipe-py
# Base command for container
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment