docker/Dockerfile: Fix image building (#932)

Signed-off-by: ps1337 <ps1337@mailbox.org>
This commit is contained in:
ps 2018-11-14 07:29:44 +01:00 committed by Itay Cohen
parent fcf007ab8a
commit 8364df066d

View File

@ -4,51 +4,32 @@ LABEL maintainer "pschmied <ps1337@mailbox.org>"
# Dependencies # Dependencies
RUN apt-get update && \ RUN apt-get update && \
apt-get -y install \ apt-get -y install \
cmake \ cmake \
curl \ curl \
g++ \ g++ \
gcc \ gcc \
git-core \ git-core \
gosu \ gosu \
libqt5svg5-dev \ libqt5svg5-dev \
make \ make \
pkg-config \ pkg-config \
python3 \ python3 \
python3-dev \ python3-dev \
qtbase5-dev \ qt5-default \
qtwebengine5-dev \ qtbase5-dev \
unzip \ qtwebengine5-dev \
wget unzip \
wget
# Get latest cutter release # Get latest cutter release
WORKDIR /opt WORKDIR /opt
RUN curl https://api.github.com/repos/radareorg/cutter/releases/latest | \ RUN git clone --recurse-submodules https://github.com/radareorg/cutter.git && \
grep "zipball_url" | \ cd cutter && \
tr -d ",\" " | \ git checkout tags/$(git tag | tail -1)
cut -d ":" -f 2,3 | \
wget -O cutter.zip -i - && \
unzip cutter.zip && \
rm cutter.zip && \
mv radareorg-cutter* cutter
# Get latest radare2 release and build it
WORKDIR /opt/cutter
RUN rm -rf radare2 && \
curl https://api.github.com/repos/radare/radare2/releases/latest | \
grep "zipball_url" | \
tr -d ",\" " | \
cut -d ":" -f 2,3 | \
wget -O radare2.zip -i - && \
unzip radare2.zip && \
rm radare2.zip && \
mv radare-radare2* radare2 && \
cd radare2 && ./sys/install.sh
# Build cutter # Build cutter
RUN mkdir build WORKDIR /opt/cutter
WORKDIR /opt/cutter/build RUN bash build.sh
RUN cmake ../src && \
make
# Add r2 user # Add r2 user
RUN useradd r2 RUN useradd r2
@ -56,9 +37,8 @@ RUN useradd r2
# Prepare files to mount configurations later on # Prepare files to mount configurations later on
RUN mkdir /var/sharedFolder && \ RUN mkdir /var/sharedFolder && \
mkdir -p /home/r2/.config/radare2 && \ mkdir -p /home/r2/.config/radare2 && \
touch /home/r2/.radare2rc touch /home/r2/.radare2rc && \
chown -R r2:r2 /var/sharedFolder && \
RUN chown -R r2:r2 /var/sharedFolder && \
chown -R r2:r2 /home/r2/ chown -R r2:r2 /home/r2/
WORKDIR /home/r2 WORKDIR /home/r2