Skip to content

Instantly share code, notes, and snippets.

@nilreml
Last active March 23, 2024 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nilreml/7547741641a25353e2b093afeb615308 to your computer and use it in GitHub Desktop.
Save nilreml/7547741641a25353e2b093afeb615308 to your computer and use it in GitHub Desktop.
Apt cache & non-interactive config:
ARG DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3014
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt/lists \
# Use german apt mirror
sed -i -- 's/deb.debian.org/mirror.netcologne.de/g' /etc/apt/sources.list.d/* \
# Keep apt cache
&& rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' | tee /etc/apt/apt.conf.d/keep-cache \
# Answer yes to all non-security-related apt questions
&& echo 'APT::Get::Assume-Yes "true";' | tee /etc/apt/apt.conf.d/90assumeyes \
# Update and upgrade
&& apt-get update \
&& apt-get upgrade \
&& apt-get install --no-install-recommends \
apt-utils \
&& apt-get install --no-install-recommends \
[packages]
Debian locale config:
ENV LANG=C.UTF8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment