RAJANAGORI / Nightingale

It's a Docker Environment for Pentesting which having all the required tool for VAPT.
https://rajanagori.in/
GNU General Public License v3.0
223 stars 34 forks source link

Docker Image size is 3 GB which is much more for a docker image #16

Closed preetkaran20 closed 2 years ago

preetkaran20 commented 2 years ago

Is your feature request related to a problem? Please describe. I was checking the docker image size of the project and it is of size 3 GB.

image

The VM like Kali and others are also very heavy and as this is a docker project so sizes should be small so that people can download them, use them easily (even though I agree that there is docker layer caching but still 3 GB is huge).

Describe the solution you'd like Solutions could be:

  1. the docker file can be optimized such that the base docker image is small (use alpine or google distroless)
  2. Multiple Copy/Run statements could be merged. why? because each layer has a pointer to another (and few other things) so size increases because of layers.
  3. Docker Run and Copy statements can be structured like frequently changing statements should be below the infrequent changes.
  4. better way to handle layering issue is by using Docker Multistage builds
  5. Cleanups are of no use in docker images because it is layered architecture so if a layer is created above then removing it in next layer has no impact and it doesn't help in reducing the size. (https://github.com/RAJANAGORI/Nightingale/blob/main/Dockerfile#L348) (use multistage build, it is the best for deletion use cases)

Additional context I can help with ideas on making docker files better.

RAJANAGORI commented 2 years ago

@preetkaran20 Thanks for putting your points.

I completely agree with points 1,4 and 5 and which I'm already working that. I'm wondering about point 2,3. It could be great if you could raise PR for the same.

preetkaran20 commented 2 years ago

If you are going with 4th point then 2nd and 3rd will automatically be solved.

I might not be able to raise a PR due to time constraints but thing is if there is a PR adding Run command, i would suggest to club that Run command with existing run command and same with Copy command as well.

RAJANAGORI commented 2 years ago

Thanks for raising the issues, Multi staging build has been implemented now. closing this issue :)