-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #509 from scribblemaniac/multistage-docker
Docker improvements (multistage builds, separate os images, and more)
- Loading branch information
Showing
5 changed files
with
295 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore everything, the dockerfile always pulls from https://github.com/mvt-project/mvt.git@main | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Create main image | ||
FROM python:3.10.14-alpine3.20 as main | ||
|
||
LABEL org.opencontainers.image.url="https://mvt.re" | ||
LABEL org.opencontainers.image.documentation="https://docs.mvt.re" | ||
LABEL org.opencontainers.image.source="https://github.com/mvt-project/mvt" | ||
LABEL org.opencontainers.image.title="Mobile Verification Toolkit (Android)" | ||
LABEL org.opencontainers.image.description="MVT is a forensic tool to look for signs of infection in smartphone devices." | ||
LABEL org.opencontainers.image.base.name=docker.io/library/python:3.10.14-alpine3.20 | ||
|
||
# Install runtime dependencies | ||
RUN apk add --no-cache \ | ||
android-tools \ | ||
git \ | ||
libusb \ | ||
openjdk11-jre-headless \ | ||
sqlite | ||
|
||
# Install mvt | ||
RUN apk add --no-cache git \ | ||
&& PIP_NO_CACHE_DIR=1 pip3 install git+https://github.com/mvt-project/mvt.git@main \ | ||
&& apk del git | ||
|
||
# Installing ABE | ||
ADD https://github.com/nelenkov/android-backup-extractor/releases/download/master-20221109063121-8fdfc5e/abe.jar /opt/abe/abe.jar | ||
# Create alias for abe | ||
RUN echo 'alias abe="java -jar /opt/abe/abe.jar"' >> ~/.bashrc | ||
|
||
# Generate adb key folder | ||
RUN mkdir /root/.android && adb keygen /root/.android/adbkey | ||
|
||
ENTRYPOINT [ "/usr/local/bin/mvt-android" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# Base image for building libraries | ||
# --------------------------------- | ||
FROM ubuntu:22.04 as build-base | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install build tools and dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
build-essential \ | ||
git \ | ||
autoconf \ | ||
automake \ | ||
libtool-bin \ | ||
pkg-config \ | ||
libcurl4-openssl-dev \ | ||
libusb-1.0-0-dev \ | ||
libssl-dev \ | ||
udev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# libplist | ||
# -------- | ||
FROM build-base as build-libplist | ||
|
||
# Build | ||
RUN git clone https://github.com/libimobiledevice/libplist && cd libplist \ | ||
&& ./autogen.sh && make -j "$(nproc)" && make install DESTDIR=/build \ | ||
&& cd .. && rm -rf libplist | ||
|
||
|
||
# libimobiledevice-glue | ||
# --------------------- | ||
FROM build-base as build-libimobiledevice-glue | ||
|
||
# Install dependencies | ||
COPY --from=build-libplist /build / | ||
|
||
# Build | ||
RUN git clone https://github.com/libimobiledevice/libimobiledevice-glue && cd libimobiledevice-glue \ | ||
&& ./autogen.sh && make -j "$(nproc)" && make install DESTDIR=/build \ | ||
&& cd .. && rm -rf libimobiledevice-glue | ||
|
||
|
||
# libtatsu | ||
# -------- | ||
FROM build-base as build-libtatsu | ||
|
||
# Install dependencies | ||
COPY --from=build-libplist /build / | ||
|
||
# Build | ||
RUN git clone https://github.com/libimobiledevice/libtatsu && cd libtatsu \ | ||
&& ./autogen.sh && make -j "$(nproc)" && make install DESTDIR=/build \ | ||
&& cd .. && rm -rf libtatsu | ||
|
||
|
||
# libusbmuxd | ||
# ---------- | ||
FROM build-base as build-libusbmuxd | ||
|
||
# Install dependencies | ||
COPY --from=build-libplist /build / | ||
COPY --from=build-libimobiledevice-glue /build / | ||
|
||
# Build | ||
RUN git clone https://github.com/libimobiledevice/libusbmuxd && cd libusbmuxd \ | ||
&& ./autogen.sh && make -j "$(nproc)" && make install DESTDIR=/build \ | ||
&& cd .. && rm -rf libusbmuxd | ||
|
||
|
||
# libimobiledevice | ||
# ---------------- | ||
FROM build-base as build-libimobiledevice | ||
|
||
# Install dependencies | ||
COPY --from=build-libplist /build / | ||
COPY --from=build-libtatsu /build / | ||
COPY --from=build-libimobiledevice-glue /build / | ||
COPY --from=build-libusbmuxd /build / | ||
|
||
# Build | ||
RUN git clone https://github.com/libimobiledevice/libimobiledevice && cd libimobiledevice \ | ||
&& ./autogen.sh --enable-debug && make -j "$(nproc)" && make install DESTDIR=/build \ | ||
&& cd .. && rm -rf libimobiledevice | ||
|
||
|
||
# usbmuxd | ||
# ------- | ||
FROM build-base as build-usbmuxd | ||
|
||
# Install dependencies | ||
COPY --from=build-libplist /build / | ||
COPY --from=build-libimobiledevice-glue /build / | ||
COPY --from=build-libusbmuxd /build / | ||
COPY --from=build-libimobiledevice /build / | ||
|
||
# Build | ||
RUN git clone https://github.com/libimobiledevice/usbmuxd && cd usbmuxd \ | ||
&& ./autogen.sh --sysconfdir=/etc --localstatedir=/var --runstatedir=/run && make -j "$(nproc)" && make install DESTDIR=/build \ | ||
&& cd .. && rm -rf usbmuxd && mv /build/lib /build/usr/lib | ||
|
||
|
||
# Main image | ||
# ---------- | ||
FROM python:3.10.14-alpine3.20 as main | ||
|
||
LABEL org.opencontainers.image.url="https://mvt.re" | ||
LABEL org.opencontainers.image.documentation="https://docs.mvt.re" | ||
LABEL org.opencontainers.image.source="https://github.com/mvt-project/mvt" | ||
LABEL org.opencontainers.image.title="Mobile Verification Toolkit (iOS)" | ||
LABEL org.opencontainers.image.description="MVT is a forensic tool to look for signs of infection in smartphone devices." | ||
LABEL org.opencontainers.image.base.name=docker.io/library/python:3.10.14-alpine3.20 | ||
|
||
# Install runtime dependencies | ||
RUN apk add --no-cache \ | ||
gcompat \ | ||
libcurl \ | ||
libssl3 \ | ||
libusb \ | ||
sqlite | ||
COPY --from=build-libplist /build / | ||
COPY --from=build-libimobiledevice-glue /build / | ||
COPY --from=build-libtatsu /build / | ||
COPY --from=build-libusbmuxd /build / | ||
COPY --from=build-libimobiledevice /build / | ||
COPY --from=build-usbmuxd /build / | ||
|
||
# Install mvt | ||
RUN apk add --no-cache git \ | ||
&& PIP_NO_CACHE_DIR=1 pip3 install git+https://github.com/mvt-project/mvt.git@main \ | ||
&& apk del git | ||
|
||
ENTRYPOINT [ "/usr/local/bin/mvt-ios" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters