-
I want to use slither within a docker image, however, the docker image doesn't have python installed and I cant installed. I saw that there are ways of creating scripts using Slither, but I couldn't get the gist of it. Is there any documentation? I was thinking about creating a python script with slither then creating a executable out of it so I can add it to the docker image. How can I do this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi! Slither is written in Python, so you'll need to have Python on your Docker container to be able to run Slither or write scripts that use the Slither Python API |
Beta Was this translation helpful? Give feedback.
-
Regarding scripts that uses slither, the wiki includes a simple example that'll help you get started. Beyond that, you'll probably want to look at the slither source code directly for more info regarding the API. pyinstaller is a project that claims to build a single-file executable out of a python script. Disclaimer: I've never used pyinstaller so can't promise it'll work. Honestly, I'd recommend trying to install python in your container again. |
Beta Was this translation helpful? Give feedback.
-
So, turns out it was simpler than I though: 1 - I created a temp directory $ mkdir temp 2 - I copied the $ cp /usr/lib/python3.11/site-packages/slither/__main__.py /temp/slither-executable.py 3 - I ran pyinstaller: $ cd temp
$ pyinstaller slither-executable.py --onefile It works perfectly. Thanks for the help! |
Beta Was this translation helpful? Give feedback.
So, turns out it was simpler than I though:
1 - I created a temp directory
2 - I copied the
__main__.py
of thesite-packages
directory3 - I ran pyinstaller:
$ cd temp $ pyinstaller slither-executable.py --onefile
It works perfectly. Thanks for the help!