From 095884d8f97b1715c726b4c4be5281c95670b79e Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Tue, 26 Nov 2024 01:35:12 +0800 Subject: [PATCH] Reduce Docker image size by improving apk commands Replace redundant apk flags `-U` and `--update` with `--no-cache` to prevent package index caching. This change unifies all apk package commands for better maintainability and smaller image size. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index dcaf27cc32..8184d833a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.12.6-alpine3.20 AS builder -RUN apk --update add \ +RUN apk --no-cache add \ build-base \ libxml2-dev \ libxslt-dev \ @@ -14,11 +14,11 @@ RUN pip install --prefix /install --no-warn-script-location --no-cache-dir -r re FROM python:3.12.6-alpine3.20 -RUN apk add --update --no-cache tor curl openrc libstdc++ +RUN apk add --no-cache tor curl openrc libstdc++ # git go //for obfs4proxy # libcurl4-openssl-dev -RUN apk -U upgrade +RUN apk --no-cache upgrade # uncomment to build obfs4proxy # RUN git clone https://gitlab.com/yawning/obfs4.git