From 5f600c48e3744959870c1cae3b19a7a1eb4e3d24 Mon Sep 17 00:00:00 2001 From: Evan Sultanik Date: Thu, 23 Apr 2020 11:59:07 -0400 Subject: [PATCH] Reduces the size of the Docker image by a couple hundred MB (#70) --- Dockerfile | 67 +++++++++++++++++++----------------------------------- 1 file changed, 23 insertions(+), 44 deletions(-) diff --git a/Dockerfile b/Dockerfile index ddcbfe7..76c5cd6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,81 +1,60 @@ -FROM ubuntu:18.04 +FROM ubuntu:bionic MAINTAINER Evan Sultanik -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN DEBIAN_FRONTEND=noninteractive \ + apt-get update && apt-get install -y --no-install-recommends \ curl \ ca-certificates \ bash-completion \ sudo \ -&& rm -rf /var/lib/apt/lists/* - -RUN curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && sudo apt-get install -y --no-install-recommends nodejs && rm -rf /var/lib/apt/lists/* - -RUN npm install --production -g ganache-cli truffle && npm --force cache clean - -# BEGIN Requirements for Manticore: - -RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \ python3 \ libpython3-dev \ python3-pip \ + python3-setuptools \ git \ build-essential \ software-properties-common \ + locales-all locales \ + libudev-dev \ + gpg-agent \ +&& apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN add-apt-repository -y ppa:ethereum/ethereum && \ - apt-get update && \ - apt-get install -y --no-install-recommends solc ethereum \ +RUN DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:ethereum/ethereum && \ + apt-get update && apt-get install -y --no-install-recommends \ + solc \ + ethereum \ +&& apt-get clean \ && rm -rf /var/lib/apt/lists/* -# END Requirements for Manticore +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/* + +RUN npm install --production -g ganache-cli truffle && npm --force cache clean # BEGIN Install Echidna -WORKDIR /root -RUN apt-get update && apt-get install -y --no-install-recommends \ - cmake curl wget libgmp-dev libssl1.0-dev libbz2-dev libreadline-dev \ - software-properties-common locales-all locales libsecp256k1-dev \ - python3-setuptools \ -&& rm -rf /var/lib/apt/lists/* -COPY docker/install-libff.sh . -RUN ./install-libff.sh && rm ./install-libff.sh -RUN apt-get update && \ - curl -sSL https://get.haskellstack.org/ | sh && \ - rm -rf /var/lib/apt/lists/* +COPY --from=docker.pkg.github.com/crytic/echidna/echidna:latest /root/.local/bin/echidna-test /usr/local/bin/echidna-test + +RUN update-locale LANG=en_US.UTF-8 && locale-gen en_US.UTF-8 +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 + +# END Install Echidna RUN useradd -m etheno RUN usermod -aG sudo etheno USER etheno WORKDIR /home/etheno -ENV HOME /home/etheno -ENV PATH $PATH:$HOME/.local/bin -ENV LANG C.UTF-8 - -RUN git clone https://github.com/trailofbits/echidna.git && \ - cd echidna && \ - stack upgrade && \ - stack setup && \ - stack install --extra-include-dirs=/usr/local/include --extra-lib-dirs=/usr/local/lib && \ - stack purge && \ - cd .. && \ - rm -rf .stack echidna - -# END Install Echidna - USER root WORKDIR /root # Install Parity -RUN apt-get update && \ - apt-get install -y --no-install-recommends libudev-dev && \ - rm -rf /var/lib/apt/lists/* RUN curl https://get.parity.io -L | bash # Allow passwordless sudo for etheno RUN echo 'etheno ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers USER etheno +ENV HOME=/home/etheno PATH=$PATH:/home/etheno/.local/bin WORKDIR /home/etheno COPY --chown=etheno:etheno LICENSE setup.py etheno/