Files
ethereum-rpc-docker/op/Dockerfile.debug
Sebastian 86642de9ca maybe fix
2024-10-26 07:38:22 +02:00

107 lines
2.6 KiB
Docker

FROM node:20 as nodebuild
# this helps to rewind a chain like so
# ./op-w/bin/op-wheel engine set-forkchoice --unsafe=16966680 --safe=16966680 --finalized=16966680 --engine=http://localhost:8551/ --engine.jwt-secret=/jwtsecret
WORKDIR /app
RUN apt-get update && apt-get install -y \
curl \
jq \
python3 \
ca-certificates \
git \
g++ \
make \
gcc \
musl-dev \
bash \
# the following 4 deps are needed for node-hid
# which is a deep sub dependency of ethers to install
# correctly
pkg-config \
libusb-1.0-0-dev \
libudev-dev \
--no-install-recommends
# Clone the repository and checkout the specific commit
ARG OP_NODE_REPO=https://github.com/ethereum-optimism/optimism.git
ARG OP_NODE_VERSION
ARG OP_NODE_COMMIT
RUN git clone $OP_NODE_REPO --branch $OP_NODE_VERSION --single-branch . && \
git switch -c branch-$OP_NODE_VERSION
# Install pnpm
#RUN npm install -g pnpm && \
# curl -L https://foundry.paradigm.xyz | bash
#ENV PATH="${PATH}:/root/.foundry/bin"
#RUN /root/.foundry/bin/foundryup
# Assuming the op-node project is located at the root of the repository
# Install dependencies and build the project
#RUN cd op-node && pnpm install && pnpm build && ls
# Now, switch to the Golang image for the rest of the operations
FROM golang:1.22 as op-node
WORKDIR /app
# Copy the op-node project's source code and build artifacts
COPY --from=nodebuild /app /app
RUN cd op-node && ls && \
make op-node
FROM golang:1.22 as op-wheel
WORKDIR /app
# Copy the op-node project's source code and build artifacts
COPY --from=nodebuild /app /app
RUN cd op-wheel && \
make op-wheel
FROM golang:1.22 as geth
WORKDIR /app
ARG OP_GETH_REPO=https://github.com/ethereum-optimism/op-geth.git
ARG OP_GETH_VERSION
ARG OP_GETH_COMMIT
# avoid depth=1, so the geth build can read tags
RUN git clone $OP_GETH_REPO --branch $OP_GETH_VERSION --single-branch . && \
git switch -c branch-$OP_GETH_VERSION
RUN go run build/ci.go install -static ./cmd/geth
FROM golang:1.22
RUN apt-get update && \
apt-get install -y jq curl supervisor && \
rm -rf /var/lib/apt/lists
RUN mkdir -p /var/log/supervisor
WORKDIR /app
COPY --from=op-node /app/op-node/bin/ ./
COPY --from=op-node /app/op-node/bin/ /bin/
#run mkdir op-n
#COPY --from=op-node / ./op-n
run mkdir op-w
COPY --from=op-wheel /app/op-wheel/ ./op-w
COPY --from=geth /app/build/bin/geth ./
COPY --from=geth /app/build/bin/geth /bin/
# COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY geth-entrypoint .
COPY op-node-entrypoint .
#COPY goerli ./goerli
COPY sepolia ./sepolia
COPY mainnet ./mainnet
# CMD ["/usr/bin/supervisord"]