-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dockerfile: make image slimmer, based on distroless * GitHub Actions: configure docker buildx * GitHub Actions: move to ghcr.io * Move dockerfile, add solc-install wrapper * Add solc-select to python environment * Disable wheel caching * Add debian-based image * Build and tag both debian and distroless images * Reorganize tags, use build and push action * Add NVM variant * Indicate Dockerfile path correctly * Unify Debian variants * Switch to Docker metadata action * Improve Docker section on README * Enable caching of layers * Update action versions * Move back to Ubuntu To keep the same distro we were using previously * Disable building distroless * Publish the images under the previous names * Fix naming and publishing * Use ubuntu focal Try fixing missing __xmknod symbol with ubuntu jammy * Make apt-get installs non-interactive * Remove 'ubuntu' ghcr image name * Add setuptools, distutils and pip Otherwise the final environment is slightly broken if someone tries to install extra packages * Add UTF-8 locale Echidna prints emojis and will throw an error if the locale is not set correctly. * README: fix some markdownlint warnings * README: adjust Docker documentation
- Loading branch information
Showing
5 changed files
with
197 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM ubuntu:focal 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 \ | ||
cmake \ | ||
curl \ | ||
git \ | ||
libbz2-dev \ | ||
libgmp-dev \ | ||
libreadline-dev \ | ||
libsecp256k1-dev \ | ||
libssl-dev \ | ||
software-properties-common \ | ||
sudo | ||
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 && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends \ | ||
gcc \ | ||
python3.8-dev \ | ||
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 | ||
|
||
|
||
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 && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
python3 \ | ||
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 | ||
ENV LANG="C.UTF-8" | ||
ENV PATH="$PATH:/venv/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/python3 | ||
import os | ||
import shutil | ||
import subprocess | ||
import sys | ||
|
||
## solc-install: simple wrapper script to invoke solc-select install when required | ||
## | ||
## This script will observe the SOLC_VERSION variable. If it is set, it will install | ||
## and globally select said solc version. | ||
|
||
if len(sys.argv) < 2: | ||
print(f"Usage: {sys.argv[0]} other-program [args..]") | ||
sys.exit(1) | ||
|
||
solc_version = os.getenv('SOLC_VERSION', None) | ||
if solc_version: | ||
silent = os.getenv("SOLC_SELECT_SILENT", "1") == "1" and subprocess.DEVNULL or None | ||
subprocess.run(['solc-select', 'install', solc_version], stderr=silent, stdout=silent) | ||
subprocess.run(['solc-select', 'use', solc_version], stderr=silent, stdout=silent) | ||
|
||
os.execv(shutil.which(sys.argv[1]), sys.argv[1:]) |