Skip to content

Instantly share code, notes, and snippets.

@thimslugga
Created June 18, 2025 10:32
Show Gist options
  • Save thimslugga/96bb9a64fb2bf64cec5c824c569e8679 to your computer and use it in GitHub Desktop.
Save thimslugga/96bb9a64fb2bf64cec5c824c569e8679 to your computer and use it in GitHub Desktop.
Amazon Linux 2023 Minimal Container Image
# syntax=docker/dockerfile:1
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as build
RUN \
set -ex ; \
sed -i '/tsflags=nodocs/d' /etc/dnf/dnf.conf ; \
dnf --releasever=$(rpm -q system-release --qf '%{VERSION}') \
-y \
--allowerasing \
--setopt=install_weak_deps=False \
--installroot /sysroot \
install \
bash \
curl \
wget \
gnupg2 \
unzip \
tar \
gzip \
shadow-utils \
which \
procps \
git \
jq \
&& dnf clean all \
&& rm -rf /var/cache/dnf/* ; \
FROM scratch
COPY --from=build /sysroot /
WORKDIR /
ENTRYPOINT ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment