Differences Between Standard Docker Images and Alpine \ Slim Versions

Hi,

I am new(ish) to Docker \ Virtualisation and am hoping someone could assist in clearing the following up:

  1. Is there any major differences (e.g. things stripped out, not included, etc.) between a Standard Docker Image, Alpine Linux Docker Image, and a Slim Docker Image?

  2. Is there a way to compare the differences between each Docker Image version (e.g. a comparison site) without the need to install them and compare?

An example I am interested in is the NGINX Docker Image. The Standard Docker Image is 142MB whilst the Alpine Version is only 23.5MB. Whilst building on Alpine Linux would reduce the size of the image, I feel something would have had to be stripped out to shrink it this much.

Thanks in advance,

t0ny84

2 Likes

Hi t0ny84,

I’d be happy to help you with your questions about Docker images!

  1. Is there any major differences (e.g. things stripped out, not included, etc.) between a Standard Docker Image, Alpine Linux Docker Image, and a Slim Docker Image?

Yes, there are some differences between these types of Docker images:

  • Standard Docker Image: These images are typically based on a full Linux distribution like Ubuntu or Debian and include a wide range of pre-installed packages and dependencies. They tend to be larger in size than other types of images.
  • Alpine Linux Docker Image: Alpine Linux is a lightweight Linux distribution that is designed to be small and secure. Alpine-based Docker images are typically much smaller than standard images, as they include only the bare essentials needed to run the application.
  • Slim Docker Image: These images are similar to Alpine-based images in that they are designed to be small and efficient. However, they are not necessarily based on Alpine Linux and can use other lightweight Linux distributions like CentOS or Debian. Slim images typically include only the necessary packages and dependencies to run the application, but may still be larger than Alpine-based images.

When choosing which type of Docker image to use, it’s important to consider the specific requirements of your application. If you need a full Linux distribution with a wide range of packages and dependencies, a standard image may be the best choice. If you need a lightweight image that is optimized for size and security, an Alpine-based or slim image may be a better choice.

  1. Is there a way to compare the differences between each Docker Image version (e.g. a comparison site) without the need to install them and compare?

Yes, you can compare the differences between Docker images without the need to install them. One way to do this is to use the Docker Hub website, which allows you to view the Dockerfile used to build each image. The Dockerfile is a text file that specifies the exact steps used to build the image, including the base image, packages installed, and configuration files created.

To view the Dockerfile for an image on Docker Hub, simply navigate to the image’s page and click on the “Dockerfile” tab. This will show you the exact steps used to build the image, so you can compare the differences between versions.

For example, you can view the Dockerfiles for the NGINX Docker images on Docker Hub:

  • Standard NGINX Docker Image: Docker
  • Alpine NGINX Docker Image: Docker

By comparing the Dockerfiles for each image, you can see the differences in packages installed and configuration files created, which may help you understand why the Alpine-based image is much smaller than the standard image.

I hope that helps! Let me know if you have any more questions.

Sourav

5 Likes

Hey dsourav155,

Thanks so much this is perfect, it’s clear, direct, and easy to understand! :star_struck:
From what I originally had read I thought the actual program in the docker image itself (e.g. NGINX) had been stripped down. Like the game releases of years gone by!

Thanks again,

t0ny84