From 417036cbecb497e36d7a5584bad4eef9dabf0a93 Mon Sep 17 00:00:00 2001 From: RadiusDeck Dev Date: Fri, 16 Oct 2026 15:32:57 +0700 Subject: [PATCH] fix: remove pip from runtime image --- Dockerfile | 6 +++++- tests/test.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a5e4e8..48dcd82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,10 @@ LABEL org.opencontainers.image.title="docker-reload-sidecar" \ RUN apk update && apk upgrade --no-cache && rm -rf /var/cache/apk/* +# The stdlib-only runtime needs neither pip nor its bundled bootstrap wheel. +RUN python -m pip uninstall --yes pip \ + && python -c "import shutil, sysconfig; shutil.rmtree(sysconfig.get_path('stdlib') + '/ensurepip')" + COPY server.py /server.py EXPOSE 9090 @@ -16,4 +20,4 @@ ENV PYTHONUNBUFFERED=1 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:9090/health')" || exit 1 -CMD ["python", "/server.py"] \ No newline at end of file +CMD ["python", "/server.py"] diff --git a/tests/test.sh b/tests/test.sh index 52ef4dd..0864ebe 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -128,4 +128,4 @@ echo "===================================" if [ "$FAIL" -gt 0 ]; then exit 1 -fi \ No newline at end of file +fi