2020-01-14 06:52:37 +00:00
|
|
|
FROM alpine:latest AS builder
|
2019-07-19 23:42:54 +00:00
|
|
|
LABEL maintainer "Philipp Schmied <ps1337@mailbox.org>"
|
2018-06-25 09:43:59 +00:00
|
|
|
|
2019-05-03 10:55:35 +00:00
|
|
|
# Prevent build fails because of interactive scripts when compiling
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
2018-06-25 09:43:59 +00:00
|
|
|
# Dependencies
|
2019-07-19 23:42:54 +00:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
cmake \
|
|
|
|
curl \
|
|
|
|
g++ \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
linux-headers \
|
|
|
|
make \
|
|
|
|
pkgconfig \
|
|
|
|
python3-dev \
|
|
|
|
qt5-qtbase \
|
|
|
|
qt5-qtsvg-dev \
|
|
|
|
qt5-qttools-dev \
|
|
|
|
unzip \
|
|
|
|
wget
|
2018-06-25 09:43:59 +00:00
|
|
|
|
2019-01-29 13:09:39 +00:00
|
|
|
# Get, compile and test Cutter from master branch
|
2019-07-19 23:42:54 +00:00
|
|
|
RUN git clone --recurse-submodules https://github.com/radareorg/cutter.git /opt/cutter
|
|
|
|
RUN cd /opt/cutter && \
|
2019-01-29 13:09:39 +00:00
|
|
|
bash build.sh && \
|
|
|
|
bash -c 'if [[ ! -x "/opt/cutter/build/Cutter" ]]; then exit -1; fi'
|
2019-01-04 16:11:29 +00:00
|
|
|
|
2020-01-14 06:52:37 +00:00
|
|
|
FROM alpine:latest AS runner
|
2019-07-19 23:42:54 +00:00
|
|
|
|
|
|
|
# Add the dependencies we need for running
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
libuuid \
|
|
|
|
make \
|
|
|
|
python3 \
|
|
|
|
qt5-qtbase \
|
|
|
|
shadow \
|
|
|
|
su-exec
|
|
|
|
|
|
|
|
# Get the compiled Cutter, r2 libs and bins from the builder
|
|
|
|
COPY --from=builder /opt/cutter /opt/cutter
|
|
|
|
COPY --from=builder /usr/lib /usr/lib
|
|
|
|
COPY --from=builder /usr/share/radare2 /usr/share/radare2
|
|
|
|
RUN cd /opt/cutter/radare2/binr && \
|
|
|
|
make install && \
|
|
|
|
make symstall install-symlink
|
|
|
|
|
2018-06-25 09:43:59 +00:00
|
|
|
# Add r2 user
|
|
|
|
RUN useradd r2
|
|
|
|
|
2018-06-30 11:50:05 +00:00
|
|
|
# Prepare files to mount configurations later on
|
|
|
|
RUN mkdir /var/sharedFolder && \
|
|
|
|
mkdir -p /home/r2/.config/radare2 && \
|
2018-11-14 06:29:44 +00:00
|
|
|
touch /home/r2/.radare2rc && \
|
|
|
|
chown -R r2:r2 /var/sharedFolder && \
|
2018-06-30 11:50:05 +00:00
|
|
|
chown -R r2:r2 /home/r2/
|
2018-06-25 09:43:59 +00:00
|
|
|
|
2018-06-30 11:50:05 +00:00
|
|
|
WORKDIR /home/r2
|
|
|
|
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
|
2019-07-19 23:42:54 +00:00
|
|
|
|
2018-06-30 11:50:05 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|