Remove redundant apk update in Dockerfiles (cc #5016) (#9055)

The `apk` commands can utilize the `--no-cache` option, making the
`update` step superfluous and ensuring the latest packages are used
without maintaining a local cache. An additional `apk update` in the
Dockerfile will just make the image larger with no benefits.
This commit is contained in:
Peter Dave Hello 2025-04-09 00:03:25 +08:00 committed by GitHub
parent 0a59a8c659
commit 4be89b244c
3 changed files with 5 additions and 9 deletions

View file

@ -12,8 +12,7 @@ WORKDIR /app
USER root USER root
# Install build dependencies # Install build dependencies
RUN apk update && \ RUN apk add --no-cache gcc python3-dev openssl openssl-dev
apk add --no-cache gcc python3-dev openssl openssl-dev
RUN pip install --upgrade pip && \ RUN pip install --upgrade pip && \
@ -52,8 +51,7 @@ FROM $LITELLM_RUNTIME_IMAGE AS runtime
USER root USER root
# Install runtime dependencies # Install runtime dependencies
RUN apk update && \ RUN apk add --no-cache openssl
apk add --no-cache openssl
WORKDIR /app WORKDIR /app
# Copy the current directory contents into the container at /app # Copy the current directory contents into the container at /app

View file

@ -35,7 +35,7 @@ RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt
FROM $LITELLM_RUNTIME_IMAGE AS runtime FROM $LITELLM_RUNTIME_IMAGE AS runtime
# Update dependencies and clean up # Update dependencies and clean up
RUN apk update && apk upgrade && rm -rf /var/cache/apk/* RUN apk upgrade --no-cache
WORKDIR /app WORKDIR /app

View file

@ -12,8 +12,7 @@ WORKDIR /app
USER root USER root
# Install build dependencies # Install build dependencies
RUN apk update && \ RUN apk add --no-cache gcc python3-dev openssl openssl-dev
apk add --no-cache gcc python3-dev openssl openssl-dev
RUN pip install --upgrade pip && \ RUN pip install --upgrade pip && \
@ -44,8 +43,7 @@ FROM $LITELLM_RUNTIME_IMAGE AS runtime
USER root USER root
# Install runtime dependencies # Install runtime dependencies
RUN apk update && \ RUN apk add --no-cache openssl
apk add --no-cache openssl
WORKDIR /app WORKDIR /app
# Copy the current directory contents into the container at /app # Copy the current directory contents into the container at /app