Sitemap
JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Member-only story

Featured

Optimise Your Docker Images with Multi-Stage Docker Builds

--

Imagine our server has 120 GB of available storage, and each of your Docker images is 1.2 GB.

Press enter or click to view image in full size

Not a member yet? Please read it here

How many docker images can you store on that server?

100 images can be stored aproximately, assuming the entire 120 GB is available exclusively for Docker images.

Let’s say you can reduce each image size to 120 MB. Imagine how many docker images can be stored, and we are also optimising storage, improving deployment speed and keeping containers cleaner.

Let’s see how we can reduce docker image size without compromising the application. In this blog, we will explore how to optimise docker images and build smaller, more efficient containers using multi-stage Docker builds, with an example of a Node JS application.

Quick docker refresh

A Docker image is a template for creating a docker container. Docker container has everything that the application needs to run. Docker image is built using a Dockerfile.

  • Every Dockerfile starts with importing a base image.
  • Then we set up a working directory.
  • Copying code from the local system.

--

--

I’m a postgraduate in Computer Applications with 8+ years of experience in web development. Currently pursuing an MTech in cloud computing.

See more from me

JavaScript in Plain English
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.