ci: fix Docker build

This fixes some issues with the Docker build process

  * missing `git` in wheel build process - pip requires Git to pull
    dependencies expressed as `foo @ git+https://...`.

  * pip upgrade before building - it was disabled with an extra `echo`
    Thanks to @ahpaleus for reporting this!

  * final image installation - pip insists on rebuilding git-referenced
    dependencies, so this installs the wheels directly with `--no-deps`
    to get the desired behavior.
pull/1564/head
Emilio López 2 years ago
parent 55c24280cf
commit 024729aa2f
  1. 5
      Dockerfile

@ -2,6 +2,7 @@
FROM ubuntu:jammy AS python-wheels FROM ubuntu:jammy AS python-wheels
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
gcc \ gcc \
git \
python3-dev \ python3-dev \
python3-pip \ python3-pip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -9,7 +10,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
COPY . /slither COPY . /slither
RUN cd /slither && \ RUN cd /slither && \
echo pip3 install --no-cache-dir --upgrade pip && \ pip3 install --no-cache-dir --upgrade pip && \
pip3 wheel -w /wheels . solc-select pip setuptools wheel pip3 wheel -w /wheels . solc-select pip setuptools wheel
@ -44,7 +45,7 @@ ENV PATH="/home/slither/.local/bin:${PATH}"
# no-index ensures we install the freshly-built wheels # no-index ensures we install the freshly-built wheels
RUN --mount=type=bind,target=/mnt,source=/wheels,from=python-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 solc-select pip3 install --user --no-cache-dir --upgrade --no-index --find-links /mnt --no-deps /mnt/*.whl
RUN solc-select install 0.4.25 && solc-select use 0.4.25 RUN solc-select install 0.4.25 && solc-select use 0.4.25

Loading…
Cancel
Save