11FROM python:3.11-slim
2+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23
34ARG TARGETARCH
45
@@ -42,8 +43,7 @@ WORKDIR ${PYTHONPATH}/stringsifter
4243COPY ./requirements/stringsifter-requirements.txt ./stringsifter/wrapper.py ./
4344# Installed at system level because virtualenv does not work as expected
4445# ModuleNotFoundError: No module named 'pybind11' while trying to build
45- RUN pip3 install --no-cache-dir --upgrade pip \
46- && pip3 install --no-cache-dir -r stringsifter-requirements.txt \
46+ RUN uv pip install --system -r stringsifter-requirements.txt \
4747 && chmod +x wrapper.py
4848
4949# Build Qiling
@@ -53,44 +53,41 @@ COPY ./requirements/qiling-requirements.txt ./qiling/analyze.py ./
5353RUN if [[ $TARGETARCH == "amd64" ]]; then \
5454 python3 -m venv venv \
5555 && . venv/bin/activate \
56- && pip3 install --no-cache-dir --upgrade pip \
57- && pip3 install --no-cache-dir -r qiling-requirements.txt; fi
56+ && uv pip install --system -r qiling-requirements.txt; fi
5857
5958# Then Build every possible other Python application inside its virtual environment
6059# Build guelfo's PEFrame
6160WORKDIR ${PYTHONPATH}/peframe
6261COPY ./requirements/peframe-requirements.txt ./
6362RUN python3 -m venv venv \
6463 && . venv/bin/activate \
65- && pip3 install --no-cache-dir --upgrade pip \
66- && pip3 install --no-cache-dir -r peframe-requirements.txt --no-cache-dir
64+ && uv pip install --system -r peframe-requirements.txt --no-cache-dir
6765
6866# Install guelfo's artifacts
6967# there is no version management on this project so we just pull the most recent changes
7068WORKDIR ${PYTHONPATH}/artifacts
7169RUN python3 -m venv venv \
7270 && . venv/bin/activate \
73- && pip3 install --no-cache-dir --upgrade pip \
71+
7472 && git clone https://github.com/guelfoweb/artifacts.git \
7573 && cd artifacts \
76- && pip install --no-cache-dir -r requirements.txt \
74+ && uv pip install -r requirements.txt \
7775 && chmod +x artifacts.py
7876
7977# Build APKiD
8078WORKDIR ${PYTHONPATH}/apkid
8179COPY ./requirements/apkid-requirements.txt ./
8280RUN python3 -m venv venv \
8381 && . venv/bin/activate \
84- && pip3 install --no-cache-dir --upgrade pip \
85- && pip3 install --no-cache-dir -r apkid-requirements.txt
82+ && uv pip install --system -r apkid-requirements.txt
8683
8784# Install DroidLysis
8885WORKDIR "${PYTHONPATH}/droidlysis"
8986COPY ./requirements/droidlysis-requirements.txt ./
9087RUN python3 -m venv venv \
9188 && . venv/bin/activate \
92- && pip3 install --no-cache-dir --upgrade pip \
93- && pip3 install --no-cache-dir -r droidlysis-requirements.txt --no-cache-dir \
89+
90+ && uv pip install -r droidlysis-requirements.txt --no-cache-dir \
9491 && mkdir -p ~/softs \
9592 && cd ~/softs \
9693 && wget -q https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.9.3.jar \
@@ -102,7 +99,7 @@ RUN python3 -m venv venv \
10299 && mkdir -p "${PYTHONPATH}/droidlysis/out" "${PYTHONPATH}/droidlysis/conf" /root/.cache/droidlysis \
103100 && chown -R ${USER}:${USER} /root/.cache/droidlysis \
104101 && chmod 711 /root/ \
105- && DROIDLYSIS_PATH="$(pip3 show droidlysis | grep Location | cut -d ' ' -f 2)" \
102+ && DROIDLYSIS_PATH="$(uv pip show droidlysis | grep Location | cut -d ' ' -f 2)" \
106103 && cp "${DROIDLYSIS_PATH}/conf/" *.conf "${PYTHONPATH}/droidlysis/conf/" \
107104 && rm -f "${PYTHONPATH}/droidlysis/conf/general.conf"
108105COPY ./droidlysis/general.conf ${PYTHONPATH}/droidlysis/conf/general.conf
@@ -112,8 +109,7 @@ WORKDIR ${PYTHONPATH}/mobsf
112109COPY ./requirements/mobsf-requirements.txt ./
113110RUN python3 -m venv venv \
114111 && . venv/bin/activate \
115- && pip3 install --no-cache-dir --upgrade pip \
116- && pip3 install --no-cache-dir -r mobsf-requirements.txt \
112+ && uv pip install --system -r mobsf-requirements.txt \
117113 && mkdir -p /root/.semgrep/ \
118114 && chown -R ${USER}:${USER} /root/.semgrep \
119115 && chmod 711 /root
@@ -130,8 +126,7 @@ WORKDIR ${PYTHONPATH}/flask
130126COPY app.py ./requirements/flask-requirements.txt entrypoint.sh ./
131127RUN python3 -m venv venv \
132128 && . venv/bin/activate \
133- && pip3 install --no-cache-dir --upgrade pip \
134- && pip3 install --no-cache-dir -r flask-requirements.txt \
129+ && uv pip install --system -r flask-requirements.txt \
135130 && chmod +x entrypoint.sh
136131
137132# Cleanup
0 commit comments