Skip to content

Optimize Dockerfile to use apk with --no-cache #743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ FROM python:3.12.6-alpine3.20 AS base
RUN python -m pip install --upgrade pip setuptools

# Upgrade system packages to install security updates
RUN apk update && \
apk upgrade
RUN apk upgrade --no-cache

# ---- Back-end builder image ----
FROM base AS back-builder
Expand Down Expand Up @@ -38,7 +37,7 @@ FROM base AS link-collector
ARG IMPRESS_STATIC_ROOT=/data/static

# Install pango & rdfind
RUN apk add \
RUN apk add --no-cache \
pango \
rdfind

Expand All @@ -64,7 +63,7 @@ FROM base AS core
ENV PYTHONUNBUFFERED=1

# Install required system libs
RUN apk add \
RUN apk add --no-cache \
cairo \
file \
font-noto \
Expand Down Expand Up @@ -110,7 +109,7 @@ FROM core AS backend-development
USER root:root

# Install psql
RUN apk add postgresql-client
RUN apk add --no-cache postgresql-client

# Uninstall impress and re-install it in editable mode along with development
# dependencies
Expand Down