KathanP19 / JSFScan.sh

Automation for javascript recon in bug bounty.
889 stars 163 forks source link

Dockerfile improvements #26

Closed aminvakil closed 2 years ago

aminvakil commented 3 years ago
  1. --no-install-recommends
  2. apt is for end-user to use, Dockerfiles should use apt-get
  3. /var/lib/apt/lists/* should be removed to reduce the image size
  4. /usr/share/doc && /usr/share/man are most probably not going to be used in a container, better to be removed.
  5. apt-get clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
aminvakil commented 3 years ago

This does not get built correctly and fails with

-----------------------INSTALLING LINKFINDER------------------------
Cloning into 'LinkFinder'...
/jsfscan
Requirement already satisfied: jsbeautifier in /root/.local/lib/python3.7/site-packages (from -r ./tools/LinkFinder/requirements.txt (line 1)) (1.14.0)
Requirement already satisfied: six>=1.13.0 in /root/.local/lib/python3.7/site-packages (from jsbeautifier->-r ./tools/LinkFinder/requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: editorconfig>=0.12.2 in /root/.local/lib/python3.7/site-packages (from jsbeautifier->-r ./tools/LinkFinder/requirements.txt (line 1)) (0.12.3)
Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'
/jsfscan

-----------------------FINISHED INSTALLING LINKFINDER------------------------

I suspect there is a package which gets installed without this PR which --no-install-recommends prevents it from getting installed, hence the problem.

Fixed in https://github.com/KathanP19/JSFScan.sh/pull/26/commits/dbc29df03f3adaeaa7444ce7a136b6062bad2818.

aminvakil commented 3 years ago

This results in almost 140MB reduction in final image.

jsfscan                               amin2      e74be5f7ed59   1 second ago     1.24GB
jsfscan                               latest     0fe6fe1893f4   13 minutes ago   1.37GB
aminvakil commented 3 years ago

cc @bolli95

KathanP19 commented 2 years ago

Thank you @aminvakil for the pull request, I think @m-boll is not active, merging the pull now.