Which of the following is the main reason to choose Alpine Linux as a Docker base image?
Think about what helps reduce the size of Docker images.
Alpine Linux is chosen mainly because it is very small (around 5MB), which helps keep Docker images lightweight and fast to download.
Given the following Dockerfiles, which option correctly shows the approximate size difference when building the images?
FROM python:3.12-alpine RUN python --version --- FROM python:3.12-slim RUN python --version
Alpine is known for being smaller than slim.
The Alpine-based Python image is roughly 50MB, while the slim variant is larger, around 120MB, because it includes more libraries.
You want to build a Node.js app Docker image that is as small as possible but still supports native modules compilation. Which base image should you choose?
Alpine uses musl libc which can cause issues with native modules.
While Alpine is smaller, it can cause compatibility issues with native modules that expect glibc. The slim variant balances size and compatibility.
You built a Docker image using python:3.12-alpine and your app crashes with an error about missing libc. What is the most likely cause?
Think about the difference between musl and glibc.
Alpine uses musl libc, which is different from the standard glibc. Some apps or libraries expect glibc and fail on Alpine.
In a multi-stage Docker build, which approach best uses small base images to minimize final image size while ensuring build tools are available?
Think about separating build dependencies from runtime environment.
Using a full image with build tools in the first stage allows compiling, then copying only needed files into a small Alpine image keeps the final image minimal.