How to minimize the size of docker image

Hello,

My docker image is huge in size (approx 18GB) please help me with best practices minimize the size of the image.

Thanks in advance.

Regards,
Krishna

Remove the layers. Every time you have a
RUN
CMD
ect it creates another layer. Also this is helpful to look at the container. Its a Dockerfile to view the layers and why its such a large container.