Skip to content

Commit

Permalink
Add optimism docker image (#7)
Browse files Browse the repository at this point in the history
* add builder dockerfile

* update dockerfile

* update dockerfile

* optimism docker image
  • Loading branch information
fewensa authored Dec 28, 2023
1 parent 9ce0cf0 commit feee15b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
package:
- srtool
- safe-transaction-service
- optimism
steps:
- uses: actions/checkout@v4

Expand Down
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/*.DS_Store
target
.idea

package-lock.json
node_modules

generated
dist
.data

*.log

*.local.*
36 changes: 36 additions & 0 deletions docker-image/optimism/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM --platform=$BUILDPLATFORM ghcr.io/foundry-rs/foundry:latest as foundry

FROM --platform=$BUILDPLATFORM golang:1.21.3-alpine3.18 as builder

WORKDIR /app

ARG GIT_BRANCH_OPTIMISM=develop
ARG GIT_BRANCH_GETH=optimism

COPY --from=foundry /usr/local/bin/anvil /usr/local/bin
COPY --from=foundry /usr/local/bin/cast /usr/local/bin
COPY --from=foundry /usr/local/bin/chisel /usr/local/bin
COPY --from=foundry /usr/local/bin/forge /usr/local/bin

RUN apk add --no-cache make gcc musl-dev gcompat linux-headers git jq bash curl npm \
&& npm i -g pnpm

RUN git clone https://github.com/ethereum-optimism/optimism --branch=$GIT_BRANCH_OPTIMISM \
&& cd optimism \
&& pnpm install \
&& make op-node op-batcher op-proposer \
&& pnpm build

RUN git clone https://github.com/ethereum-optimism/op-geth --branch=$GIT_BRANCH_GETH \
&& cd op-geth \
&& make geth


FROM alpine:3.18

COPY --from=builder /app/op-geth/build/bin/geth /usr/local/bin/
COPY --from=builder /app/optimism/op-node/bin/op-node /usr/local/bin/
COPY --from=builder /app/optimism/op-batcher/bin/op-batcher /usr/local/bin/
COPY --from=builder /app/optimism/op-proposer/bin/op-proposer /usr/local/bin/


0 comments on commit feee15b

Please sign in to comment.