Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Git files
.git
.gitignore

# GitHub files
.github

# Documentation
*.md
LICENSE
CODEOWNERS

# Build artifacts
*.log
*.tmp
.DS_Store

# Docker test builds
Dockerfile.*
docker-compose*.yml
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
### Medusa build process
###
FROM golang:1.25 AS medusa
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

WORKDIR /src
RUN git clone https://github.com/crytic/medusa.git
RUN cd medusa && \
export LATEST_TAG="$(git describe --tags | sed 's/-[0-9]\+-g\w\+$//')" && \
WORKDIR /src/medusa
RUN LATEST_TAG="$(git describe --tags | sed 's/-[0-9]\+-g\w\+$//')" && \
export LATEST_TAG && \
git checkout "$LATEST_TAG" && \
go build -trimpath -o=/usr/local/bin/medusa -ldflags="-s -w" && \
chmod 755 /usr/local/bin/medusa
Expand All @@ -18,13 +20,15 @@ RUN cd medusa && \
### Echidna "build process"
###
FROM ghcr.io/crytic/echidna/echidna:latest AS echidna
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN chmod 755 /usr/local/bin/echidna


###
### ETH Security Toolbox - base
###
FROM ubuntu:jammy AS toolbox-base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Add common tools
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -63,6 +67,7 @@ CMD ["/bin/bash"]
### ETH Security Toolbox - interactive variant
###
FROM toolbox-base AS toolbox
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# improve compatibility with amd64 solc in non-amd64 environments (e.g. Docker Desktop on M1 Mac)
ENV QEMU_LD_PREFIX=/usr/x86_64-linux-gnu
Expand All @@ -87,7 +92,7 @@ ENV PATH="${PATH}:${HOME}/.local/bin:${HOME}/.vyper/bin:${HOME}/.foundry/bin"
# Install vyper compiler
RUN python3 -m venv ${HOME}/.vyper && \
${HOME}/.vyper/bin/pip3 install --no-cache-dir vyper && \
echo '\nexport PATH=${PATH}:${HOME}/.vyper/bin' >> ~/.bashrc
printf '\nexport PATH=${PATH}:${HOME}/.vyper/bin\n' >> ~/.bashrc

# Install foundry
RUN curl -fsSL https://raw.githubusercontent.com/foundry-rs/foundry/27cabbd6c905b1273a5ed3ba7c10acce90833d76/foundryup/install -o install && \
Expand Down Expand Up @@ -118,7 +123,7 @@ RUN git clone --depth 1 https://github.com/crytic/building-secure-contracts.git

# Configure MOTD
COPY --link --chown=root:root motd /etc/motd
RUN echo '\ncat /etc/motd\n' >> ~/.bashrc
RUN printf '\ncat /etc/motd\n' >> ~/.bashrc


###
Expand All @@ -131,14 +136,15 @@ RUN echo '\ncat /etc/motd\n' >> ~/.bashrc
### * No BSC copy
###
FROM toolbox-base AS toolbox-ci
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ENV HOME="/root"
ENV PATH="${PATH}:${HOME}/.crytic/bin:${HOME}/.vyper/bin:${HOME}/.foundry/bin"

# Install vyper compiler
RUN python3 -m venv ${HOME}/.vyper && \
${HOME}/.vyper/bin/pip3 install --no-cache-dir vyper && \
echo '\nexport PATH=${PATH}:${HOME}/.vyper/bin' >> ~/.bashrc
printf '\nexport PATH=${PATH}:${HOME}/.vyper/bin\n' >> ~/.bashrc

# Install foundry
RUN curl -fsSL https://raw.githubusercontent.com/foundry-rs/foundry/27cabbd6c905b1273a5ed3ba7c10acce90833d76/foundryup/install -o install && \
Expand All @@ -155,4 +161,4 @@ RUN python3 -m venv ${HOME}/.crytic && \
solc-select \
crytic-compile \
slither-analyzer && \
echo '\nexport PATH=${PATH}:${HOME}/.crytic/bin' >> ~/.bashrc
printf '\nexport PATH=${PATH}:${HOME}/.crytic/bin\n' >> ~/.bashrc