Dockerfile: add solc-select

pull/1335/head
Emilio López 2 years ago
parent b82a082ac7
commit 9a3b21bb71
  1. 15
      Dockerfile

@ -9,7 +9,7 @@ COPY . /slither
RUN cd /slither && \
echo pip3 install --no-cache-dir --upgrade pip && \
pip3 wheel -w /wheels . pip setuptools wheel
pip3 wheel -w /wheels . solc-select pip setuptools wheel
FROM ubuntu:jammy AS final
@ -22,18 +22,11 @@ LABEL desc="Static Analyzer for Solidity"
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y python3-pip wget
RUN wget -q https://github.com/ethereum/solidity/releases/download/v0.4.25/solc-static-linux \
&& chmod +x solc-static-linux \
&& mv solc-static-linux /usr/bin/solc
&& apt-get install -y --no-install-recommends python3-pip
RUN useradd -m slither
USER slither
# If this fails, the solc-static-linux binary has changed while it should not.
RUN [ "c9b268750506b88fe71371100050e9dd1e7edcf8f69da34d1cd09557ecb24580 /usr/bin/solc" = "$(sha256sum /usr/bin/solc)" ]
COPY --chown=slither:slither . /home/slither/slither
WORKDIR /home/slither/slither
@ -41,6 +34,8 @@ ENV PATH="/home/slither/.local/bin:${PATH}"
# no-index ensures we install the freshly-built wheels
RUN --mount=type=bind,target=/mnt,source=/wheels,from=python-wheels \
pip3 install --user --no-cache-dir --upgrade --no-index --find-links /mnt pip slither-analyzer
pip3 install --user --no-cache-dir --upgrade --no-index --find-links /mnt pip slither-analyzer solc-select
RUN solc-select install 0.4.25 && solc-select use 0.4.25
CMD /bin/bash

Loading…
Cancel
Save