Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 39 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
FROM ubuntu:focal AS builder-echidna
# syntax=docker/dockerfile:1.4

FROM ubuntu:focal-20221130 AS builder-echidna
ENV LD_LIBRARY_PATH=/usr/local/lib PREFIX=/usr/local HOST_OS=Linux
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends \
ENV DEBIAN_FRONTEND=noninteractive

RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-suggests --no-install-recommends \
cmake \
curl \
git \
Expand All @@ -11,45 +16,66 @@ RUN apt-get update && \
libsecp256k1-dev \
libssl-dev \
software-properties-common \
sudo
sudo; \
rm -rf /var/lib/apt/lists/*; \
apt-get purge -y -qq --auto-remove -o APT::AutoRemove::RecommendsImportant=false;

RUN curl -sSL https://get.haskellstack.org/ | sh
COPY . /echidna/
WORKDIR /echidna
RUN .github/scripts/install-libff.sh
RUN stack upgrade && stack setup && stack install --extra-include-dirs=/usr/local/include --extra-lib-dirs=/usr/local/lib


FROM ubuntu:focal AS builder-python3
RUN apt-get update && \
FROM ubuntu:focal-20221130 AS builder-python3

RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends \
gcc \
python3.8-dev \
python3.8-venv
python3.8-venv;

ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1

RUN python3 -m venv /venv && /venv/bin/pip3 install --no-cache --upgrade setuptools pip
RUN /venv/bin/pip3 install --no-cache slither-analyzer solc-select

RUN /venv/bin/pip3 install --no-cache slither-analyzer solc-select && yes | pip3 uninstall crytic-compile && pip3 install -U https://github.com/crytic/crytic-compile/archive/refs/heads/dev-fix-foundry-options.zip

FROM gcr.io/distroless/python3-debian11:nonroot AS final-distroless

COPY --from=builder-echidna /root/.local/bin/echidna-test /usr/local/bin/echidna-test
COPY --from=builder-python3 /venv /venv
COPY docker/solc-install.py /usr/local/bin/solc-install

ENV PATH="$PATH:/venv/bin"
ENTRYPOINT [ "/usr/local/bin/solc-install", "/usr/local/bin/echidna-test" ]


FROM ubuntu:focal AS final-ubuntu
RUN apt-get update && \
FROM ubuntu:focal-20221130 AS final-ubuntu


RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends \
ca-certificates \
locale-gen \
curl \
python3 \
python3-distutils \
&& \
rm -rf /var/lib/apt/lists/*
python3-distutils; \
&& rm -rf /var/lib/apt/lists/*
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

COPY --from=builder-echidna /root/.local/bin/echidna-test /usr/local/bin/echidna-test
COPY --from=builder-python3 /venv /venv

RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Use unicode
RUN locale-gen C.UTF-8 || true

ENV LANG="C.UTF-8"
ENV PATH="$PATH:/venv/bin"