Amazon Linux 2023 Minimal Container image
Note
The standard AL2023 container images are suitable for most use cases, and adapting to the minimal container image is likely to be more work than adapting to the regular AL2023 container image.
The Amazon Linux 2023 (AL2023) minimal container image (introduced in AL2023.2) differs from the base container image in that it only includes the absolute minimum amount of software needed to install other packages. It is not designed to be a convenient set of packages, but designed to be a minimal set of packages.
The AL2023 minimal container image is built from software components
already available in AL2023. The key difference between the minimal
container image and what is included in the AL2023 AMIs and base
container images is the package manager.
The dnf
package manager is provided by microdnf
rather than the fully featured Python based
dnf
which is included in the AMIs and base container image.
The Amazon Linux 2023 minimal container image forms the base of the
provided.al2023
AWS Lambda runtime environment.
See Comparing packages installed on Amazon Linux 2023 Container Images for a detailed list of packages included in the minimal container image and how it differs from the standard container image.
Minimal Container image size
Since the AL2023 minimal container image contains fewer packages than the AL2023 base container image, it is also significantly smaller. The below table compares the container image options of current and past releases of Amazon Linux.
Note
Image Size is as-shown on
Amazon Linux on Amazon ECR Public Gallery
Image | Version | Image Size | Note |
---|---|---|---|
Amazon Linux 1 (AL1) | 2018.03.0.20230918.0 | 62.3MB | x86-64 only |
Amazon Linux 2 | 2.0.20230926.0 | 64.2MB | aarch64 is 1.6MB larger than x86-64 |
Amazon Linux 2023 base container image | 2023.2.20231002.0 | 52.4MB | |
Amazon Linux 2023 minimal container image | 2023.2.20231002.0-minimal | 35.2MB |
Using the AL2023 Minimal Container image
The AL2023 Minimal Container Image is available on ECR
and the 2023-minimal
tag will always point to the latest
AL2023 based minimal container image, while the minimal
tag may be updated to a newer version of Amazon Linux than AL2023
You can pull these tags using docker
like this:
$
docker pull public.ecr.aws/amazonlinux/amazonlinux:minimal
$
docker pull public.ecr.aws/amazonlinux/amazonlinux:2023-minimal
An example Dockerfile
that takes the minimal container
image and installs GCC on top of it is below:
FROM public.ecr.aws/amazonlinux/amazonlinux:2023-minimal RUN dnf install -y gcc && dnf clean all