-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from elopez/docker-improvements
Docker container improvements
- Loading branch information
Showing
4 changed files
with
55 additions
and
78 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 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 |
---|---|---|
@@ -1,62 +1,59 @@ | ||
FROM ubuntu:bionic | ||
MAINTAINER Evan Sultanik | ||
# syntax=docker/dockerfile:1.3 | ||
FROM ubuntu:focal AS python-wheels | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
cmake \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-setuptools | ||
RUN --mount=type=bind,target=/etheno \ | ||
cd /etheno && \ | ||
pip3 wheel --no-cache-dir -w /wheels '.[manticore]' | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive \ | ||
apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
ca-certificates \ | ||
|
||
FROM ubuntu:focal AS final | ||
LABEL org.opencontainers.image.authors="Evan Sultanik" | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
bash-completion \ | ||
sudo \ | ||
ca-certificates \ | ||
curl \ | ||
gpg-agent \ | ||
libudev-dev \ | ||
locales \ | ||
python3 \ | ||
libpython3-dev \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
git \ | ||
build-essential \ | ||
software-properties-common \ | ||
locales-all locales \ | ||
libudev-dev \ | ||
gpg-agent \ | ||
&& apt-get clean \ | ||
sudo \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:ethereum/ethereum && \ | ||
RUN 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/* | ||
|
||
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 curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && \ | ||
sudo apt-get install -y --no-install-recommends nodejs \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# TODO: need to check whether this installation is correct | ||
RUN npm install --production -g ganache truffle && npm --force cache clean | ||
|
||
RUN useradd -m etheno | ||
RUN usermod -aG sudo etheno | ||
USER etheno | ||
WORKDIR /home/etheno | ||
USER root | ||
WORKDIR /root | ||
# BEGIN Install Etheno | ||
RUN --mount=type=bind,target=/mnt/etheno \ | ||
--mount=type=bind,target=/mnt/wheels,source=/wheels,from=python-wheels \ | ||
cd /mnt/etheno && \ | ||
pip3 install --no-cache-dir --no-index --find-links /mnt/wheels '.[manticore]' | ||
|
||
# Install Parity | ||
RUN curl https://get.parity.io -L | bash | ||
RUN useradd -m -G sudo etheno | ||
|
||
# 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 | ||
ENV HOME=/home/etheno | ||
WORKDIR /home/etheno | ||
|
||
COPY --chown=etheno:etheno LICENSE setup.py etheno/ | ||
COPY --chown=etheno:etheno etheno/*.py etheno/etheno/ | ||
|
||
RUN cd etheno && \ | ||
pip3 install --no-cache-dir && \ | ||
cd .. && \ | ||
rm -rf etheno | ||
|
||
COPY --chown=etheno:etheno examples examples/ | ||
|
||
CMD ["/bin/bash"] |
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.