cutter/docker/Dockerfile

63 lines
1.5 KiB
Docker
Raw Permalink Normal View History

FROM alpine:latest AS builder
2021-01-12 08:41:16 +00:00
LABEL maintainer "Philipp Schmied <banana@bananamafia.dev>"
# 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
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 && \
cmake .. && \
2021-01-12 08:41:16 +00:00
cmake --build . -j $(grep -c ^processor /proc/cpuinfo)
FROM alpine:latest AS runner
2021-01-12 08:41:16 +00:00
# Get the compiled Cutter from the builder
COPY --from=builder /opt/cutter /opt/cutter
# 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
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]