|
1 | | -FROM ubuntu:bionic |
2 | | -MAINTAINER Evan Sultanik |
3 | | - |
4 | | -RUN DEBIAN_FRONTEND=noninteractive \ |
5 | | - apt-get update && apt-get install -y --no-install-recommends \ |
| 1 | +# syntax=docker/dockerfile:1.3 |
| 2 | +FROM ubuntu:focal AS python-wheels |
| 3 | +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ |
| 4 | + build-essential \ |
| 5 | + ca-certificates \ |
| 6 | + cmake \ |
6 | 7 | curl \ |
| 8 | + python3-dev \ |
| 9 | + python3-pip \ |
| 10 | + python3-setuptools |
| 11 | + |
| 12 | +# Needed for rusty-rlp wheel |
| 13 | +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 14 | +ENV PATH="/root/.cargo/bin:${PATH}" |
| 15 | + |
| 16 | +RUN --mount=type=bind,target=/etheno \ |
| 17 | + cd /etheno && \ |
| 18 | + pip3 install --no-cache-dir --upgrade pip setuptools && \ |
| 19 | + pip3 wheel --no-cache-dir -w /wheels \ |
| 20 | + https://github.com/cburgdorf/rusty-rlp/archive/refs/tags/0.1.15.tar.gz \ |
| 21 | + . |
| 22 | + |
| 23 | + |
| 24 | +FROM ubuntu:focal AS ganache |
| 25 | +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ |
| 26 | + build-essential \ |
7 | 27 | ca-certificates \ |
| 28 | + curl \ |
| 29 | + gnupg \ |
| 30 | + lsb-release |
| 31 | +RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \ |
| 32 | + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs |
| 33 | +RUN npm install --omit=dev --location=global --prefix /opt/node ganache truffle |
| 34 | + |
| 35 | + |
| 36 | +FROM ubuntu:focal AS final |
| 37 | +LABEL org.opencontainers.image.authors="Evan Sultanik" |
| 38 | + |
| 39 | +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ |
8 | 40 | bash-completion \ |
9 | | - sudo \ |
| 41 | + ca-certificates \ |
| 42 | + curl \ |
| 43 | + gpg-agent \ |
| 44 | + libudev-dev \ |
| 45 | + locales \ |
10 | 46 | python3 \ |
11 | | - libpython3-dev \ |
12 | 47 | python3-pip \ |
13 | | - python3-setuptools \ |
14 | | - git \ |
15 | | - build-essential \ |
16 | 48 | software-properties-common \ |
17 | | - locales-all locales \ |
18 | | - libudev-dev \ |
19 | | - gpg-agent \ |
20 | | -&& apt-get clean \ |
| 49 | + sudo \ |
21 | 50 | && rm -rf /var/lib/apt/lists/* |
22 | 51 |
|
23 | | -RUN DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:ethereum/ethereum && \ |
| 52 | +# NOTE: solc was removed from the below command since the echidna integration is being removed |
| 53 | +# If the solc option is added back, --platform linux-amd64 needs to be added to the `docker build` command for M1 machines |
| 54 | +RUN add-apt-repository -y ppa:ethereum/ethereum && \ |
24 | 55 | apt-get update && apt-get install -y --no-install-recommends \ |
25 | | - solc \ |
26 | 56 | ethereum \ |
27 | | -&& apt-get clean \ |
28 | 57 | && rm -rf /var/lib/apt/lists/* |
29 | 58 |
|
30 | | -RUN curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && sudo apt-get install -y --no-install-recommends nodejs && apt-get clean && rm -rf /var/lib/apt/lists/* |
31 | | - |
32 | | -RUN npm install --production -g ganache-cli truffle && npm --force cache clean |
33 | | - |
34 | | -# BEGIN Install Echidna |
35 | | - |
36 | | -COPY --from=trailofbits/echidna:latest /root/.local/bin/echidna-test /usr/local/bin/echidna-test |
37 | | - |
38 | | -RUN update-locale LANG=en_US.UTF-8 && locale-gen en_US.UTF-8 |
39 | | -ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 |
| 59 | +RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \ |
| 60 | + apt-get install -y --no-install-recommends nodejs \ |
| 61 | +&& rm -rf /var/lib/apt/lists/* |
40 | 62 |
|
41 | | -# END Install Echidna |
| 63 | +COPY --from=ganache /opt/node /usr/local/ |
42 | 64 |
|
43 | | -RUN useradd -m etheno |
44 | | -RUN usermod -aG sudo etheno |
45 | | -USER etheno |
46 | | -WORKDIR /home/etheno |
47 | | -USER root |
48 | | -WORKDIR /root |
| 65 | +# BEGIN Install Etheno |
| 66 | +RUN --mount=type=bind,target=/mnt/etheno \ |
| 67 | + --mount=type=bind,target=/mnt/wheels,source=/wheels,from=python-wheels \ |
| 68 | + cd /mnt/etheno && \ |
| 69 | + pip3 install --no-cache-dir --upgrade pip setuptools && \ |
| 70 | + pip3 install --no-cache-dir --no-index --find-links /mnt/wheels . |
49 | 71 |
|
50 | | -# Install Parity |
51 | | -RUN curl https://get.parity.io -L | bash |
| 72 | +RUN useradd -m -G sudo etheno |
52 | 73 |
|
53 | 74 | # Allow passwordless sudo for etheno |
54 | 75 | RUN echo 'etheno ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers |
55 | 76 |
|
56 | 77 | USER etheno |
57 | | -ENV HOME=/home/etheno PATH=$PATH:/home/etheno/.local/bin |
58 | | -WORKDIR /home/etheno |
| 78 | +ENV HOME=/home/etheno |
59 | 79 |
|
60 | | -COPY --chown=etheno:etheno LICENSE setup.py etheno/ |
61 | | -COPY --chown=etheno:etheno etheno/*.py etheno/etheno/ |
62 | | -RUN cd etheno && \ |
63 | | - pip3 install --no-cache-dir --user '.[manticore]' && \ |
64 | | - cd .. && \ |
65 | | - rm -rf etheno |
66 | | - |
67 | | -COPY --chown=etheno:etheno examples examples/ |
| 80 | +# Use the DOCKER env variable to set hostname accordingly |
| 81 | +ENV DOCKER=1 |
| 82 | +WORKDIR /home/etheno |
68 | 83 |
|
69 | 84 | CMD ["/bin/bash"] |
0 commit comments