2020-01-14 06:52:37 +00:00
|
|
|
FROM alpine:latest AS builder
|
2021-01-12 08:41:16 +00:00
|
|
|
LABEL maintainer "Philipp Schmied <banana@bananamafia.dev>"
|
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
|
|
|
|
|
2021-01-12 08:41:16 +00:00
|
|
|
# Install dependencies required for building Cutter
|
2019-07-19 23:42:54 +00:00
|
|
|
RUN apk add --no-cache \
|
2021-01-12 08:41:16 +00:00
|
|
|
bash \
|
|
|
|
build-base \
|
|
|
|
cmake \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
libuuid \
|
|
|
|
linux-headers \
|
|
|
|
make \
|
|
|
|
meson \
|
|
|
|
pkgconfig \
|
|
|
|
python3 \
|
|
|
|
python3-dev \
|
|
|
|
qt5-qtbase \
|
|
|
|
qt5-qtsvg-dev \
|
|
|
|
qt5-qttools-dev \
|
|
|
|
shadow \
|
|
|
|
su-exec \
|
|
|
|
unzip \
|
|
|
|
wget
|
|
|
|
|
|
|
|
# Clone and build
|
|
|
|
RUN git clone --recurse-submodules https://github.com/rizinorg/cutter.git /opt/cutter && \
|
|
|
|
mkdir -p /opt/cutter/build && \
|
|
|
|
cd /opt/cutter/build && \
|
2021-03-15 04:47:51 +00:00
|
|
|
cmake .. && \
|
2021-01-12 08:41:16 +00:00
|
|
|
cmake --build . -j $(grep -c ^processor /proc/cpuinfo)
|
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
|
|
|
|
2021-01-12 08:41:16 +00:00
|
|
|
# Get the compiled Cutter from the builder
|
|
|
|
COPY --from=builder /opt/cutter /opt/cutter
|
|
|
|
|
2019-07-19 23:42:54 +00:00
|
|
|
# Add the dependencies we need for running
|
|
|
|
RUN apk add --no-cache \
|
2021-01-12 08:41:16 +00:00
|
|
|
bash \
|
|
|
|
cabextract \
|
|
|
|
libuuid \
|
|
|
|
qt5-qtbase \
|
|
|
|
qt5-qtsvg-dev \
|
|
|
|
shadow \
|
|
|
|
su-exec
|
|
|
|
|
|
|
|
# Prepare user and files to mount configurations later on
|
|
|
|
RUN useradd cutter && \
|
|
|
|
mkdir /var/sharedFolder && \
|
|
|
|
mkdir -p /home/cutter/.config/rizin && \
|
|
|
|
touch /home/cutter/.rizinrc && \
|
|
|
|
chown -R cutter:cutter /var/sharedFolder && \
|
|
|
|
chown -R cutter:cutter /home/cutter/
|
|
|
|
|
|
|
|
WORKDIR /home/cutter
|
2018-06-30 11:50:05 +00:00
|
|
|
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"]
|