forked from ethpandaops/optimism-package
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (63 loc) · 1.71 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM debian:latest as builder
WORKDIR /workspace
# Install dependencies using apt
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
make \
jq \
direnv \
bash \
curl \
gcc \
g++ \
python3 \
python3-pip \
nodejs \
npm \
vim \
build-essential \
libusb-1.0-0-dev \
libssl-dev \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install pnpm
RUN npm install -g pnpm@9
# Install Go from the official golang image
COPY --from=golang:alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
# Install web3 cli
RUN curl -LSs https://raw.githubusercontent.com/gochain/web3/master/install.sh | sh
# Install Rust and Foundry
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="/root/.foundry/bin:${PATH}"
RUN foundryup
RUN git clone https://github.com/ethereum-optimism/optimism.git && \
cd optimism && \
git checkout develop && \
git pull origin develop && \
pnpm install && \
pnpm build && \
cd op-node && \
make
# Use multi-stage build to keep the final image lean
FROM debian:stable-slim
WORKDIR /workspace
# Install dependencies using apt
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
direnv \
git \
bash \
curl \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
COPY --from=builder /workspace/optimism /workspace/optimism
COPY --from=builder /root/.foundry /root/.foundry
# Set up environment variables
ENV PATH="/root/.foundry/bin:/usr/local/go/bin:${PATH}"
# Set the working directory and default command
WORKDIR /workspace/optimism
CMD ["bash"]