cutter/docker/Dockerfile-dev
2020-12-16 11:59:23 +01:00

71 lines
1.7 KiB
Plaintext

FROM alpine:latest AS builder
LABEL maintainer "Philipp Schmied <ps1337@mailbox.org>"
# Prevent build fails because of interactive scripts when compiling
ENV DEBIAN_FRONTEND noninteractive
# Dependencies
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
# install rizin first
COPY docker/build_rizin.sh /opt/cutter/
COPY rizin /opt/cutter/rizin
WORKDIR /opt/cutter
RUN bash build_rizin.sh
COPY docker/build_cutter.sh /opt/cutter/
COPY scripts /opt/cutter/scripts
COPY src /opt/cutter/src
RUN bash build_cutter.sh && \
bash -c 'if [[ ! -x "/opt/cutter/build/Cutter" ]]; then exit -1; fi'
FROM alpine:latest AS runner
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Add the dependencies we need for running
RUN apk add --no-cache \
bash \
libuuid \
make \
python3 \
qt5-qtbase \
shadow \
su-exec
# Add rizin user
RUN useradd rizin
# Prepare files to mount configurations later on
RUN mkdir /var/sharedFolder && \
mkdir -p /home/rizin/.config/rizin && \
touch /home/rizin/.rizinrc && \
chown -R rizin:rizin /var/sharedFolder && \
chown -R rizin:rizin /home/rizin/
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
# Get the compiled Cutter, rizin 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/rizin /usr/share/rizin
WORKDIR /opt/cutter/rizin/binrz
RUN make install && \
make symstall install-symlink