Docker Image Management

Last Research question section of Docker Image Management. Q - 19/21

Which of the below can help minimize the image size?

a) Only install necessary packages within the image
b) Avoid sending unwanted files to the build context using .dockerignore
c) Combine multiple dependent instructions into a single one and cleanup temporary files
d) Move the instructions that are likely to change most frequently to the bottom of the Dockerfile
e) Use multi-stage builds.

I understand why a, c and d will help minimize the image size.
Not clear on why b would not help do the same as the lecture says that .dockerignore will ignore the unwanted files.

Can someone from this group please clarify
Thanks

The answer b will be right if we remove the first-word “Avoid”.

Thanks, :slightly_smiling_face.
Reading the option makes it clear.

Thanks

1 Like