Andrew
Andrew

Reputation: 2125

How does docker image size impact runtime characteristics?

I have constructed an image of a docker container. It is about 600MB. Let's refer to it as an image 'A'. Then I apply different cleaning (like 'apt clean') and size reduction steps (like 'rm man'), I get an image of 300MB in size. Let's refer to it as an image 'B'. As a result, image 'A' is the same as image 'B' but holds a lot of files which are never used during execution/runtime.

Note: I am aware that an image can be reduced in size if it is based on top of alpine-like base image, but let's say I can not do it due to various constraints.

I understand that:

I would like to know if the 'A' image has got any other impact on performance characteristics comparing with the 'B' image, especially:

In general, I suspect the answer is No to all of the questions, but maybe I am wrong.

Upvotes: 25

Views: 4167

Answers (1)

AstraSerg
AstraSerg

Reputation: 522

The size of the image it's only size of the directories. So it will never take more CPU or RAM (if you did not delete something, that will be loaded in RAM at startup from 'A') And a few words about pulling process: the image will be pulled from registry only first time and will be cached locally. Once you pull base image ('A') only differences will be pulled for image 'B'

Upvotes: 4

Related Questions