Skip to content

Commit

Permalink
Reduces the size of the Docker image by a couple hundred MB (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
ESultanik committed Apr 23, 2020
1 parent bd700bb commit 5f600c4
Showing 1 changed file with 23 additions and 44 deletions.
67 changes: 23 additions & 44 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand Down

0 comments on commit 5f600c4

Please sign in to comment.