From 88c9f6ba5baeea2aad87a1c661c46a2acc8ea376 Mon Sep 17 00:00:00 2001 From: DarkC0ntributor <102583472+DarkC0ntributor@users.noreply.github.com> Date: Tue, 11 Jul 2023 13:51:23 +0200 Subject: [PATCH 1/2] Shrink python size Shrink size of python images from 1GB to ~200MB --- mythic_python_base/Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mythic_python_base/Dockerfile b/mythic_python_base/Dockerfile index 7c688c2..f2ed25f 100644 --- a/mythic_python_base/Dockerfile +++ b/mythic_python_base/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-buster +FROM python:3.11-slim-bookworm as base ARG CA_CERTIFICATE ARG NPM_REGISTRY @@ -8,6 +8,8 @@ ARG DOCKER_REGISTRY_MIRROR ARG HTTP_PROXY ARG HTTPS_PROXY +FROM base as builder + RUN apt-get -y update && \ apt-get -y upgrade && \ apt-get install --no-install-recommends \ @@ -17,5 +19,8 @@ RUN apt-get -y update && \ rm -rf /var/lib/apt/lists/* && \ apt-get clean -COPY requirements.txt / -RUN pip3 install -r /requirements.txt \ No newline at end of file +RUN pip3 install mythic-container==0.2.11-rc07 pycryptodome + +FROM base + +COPY --from=builder /usr/local/lib/python3.11/ /usr/local/lib/python3.11/ From 6532a67ccf72daa26078bb7f313799a456b00b03 Mon Sep 17 00:00:00 2001 From: DarkC0ntributor <102583472+DarkC0ntributor@users.noreply.github.com> Date: Tue, 11 Jul 2023 13:54:43 +0200 Subject: [PATCH 2/2] delete unused file --- mythic_python_base/requirements.txt | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 mythic_python_base/requirements.txt diff --git a/mythic_python_base/requirements.txt b/mythic_python_base/requirements.txt deleted file mode 100644 index 299e241..0000000 --- a/mythic_python_base/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -aio-pika==9.0.4 -dynaconf==3.1.11 -ujson==5.7.0 -aiohttp==3.8.3 -psutil==5.9.4 -grpcio -grpcio-tools -pycryptodome -mythic-container==0.2.11-rc07 \ No newline at end of file