-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
33 lines (25 loc) · 1022 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.8-slim
ENV SOLC_PATH=/solc
ENV HOOKSCAN_PATH=/hookscan
WORKDIR $HOOKSCAN_PATH
# install solc>=0.8.14
RUN apt-get update && apt-get install -y curl jq wget
RUN curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/ethereum/solidity/releases \
| jq -r '.[] | select(.tag_name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+$")) \
| select((.tag_name | ltrimstr("v")) | split(".") \
| map(tonumber) >= [0, 8, 14]) | .tag_name' \
| xargs -P 8 -I {} sh -c "mkdir -p $SOLC_PATH/{}; \
wget -O $SOLC_PATH/{}/solc https://github.com/ethereum/solidity/releases/download/{}/solc-static-linux; \
chmod +x $SOLC_PATH/{}/solc"
# copy repo
COPY . .
# install pypi dependencies
RUN pip install --no-cache-dir -r requirements.txt
# move and chmod entrypoint.sh
RUN mv $HOOKSCAN_PATH/scripts/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# cleanup
RUN apt-get remove -y curl jq wget
RUN apt-get autoremove -y
# set entrypoint
ENTRYPOINT ["/entrypoint.sh"]