Skip to content

Commit

Permalink
chore(build): update base image
Browse files Browse the repository at this point in the history
  • Loading branch information
0xawaz committed Nov 12, 2024
1 parent 9144df2 commit 1db7476
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/fhevm-geth-coprocessor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:
with:
working-directory: "."
# ${{ github.event_name == 'release' || github.ref_name == 'main' }}
push_image: true
image-name: "go-coprocessor-devnode"
generate-dev-image: false
docker-file: "Dockerfile.devnode"
push_image: false
image-name: "go-ethereum-coprocessor"
image-dev-name: "go-ethereum-coprocessor-dev"
generate-dev-image: true
docker-file: "Dockerfile"
docker-file-dev: "Dockerfile.dev"
image-dev-description: "geth coprocessor dev image"
arm-build: true

secrets:
Expand Down
30 changes: 15 additions & 15 deletions Dockerfile.devnode → Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
ARG ZBC_VERSION=latest
FROM ghcr.io/zama-ai/zama-zbc-build:${ZBC_VERSION} AS build
FROM golang:1.22-alpine AS build

# Use ARG values for tool versions
ARG TARGETARCH
ARG GETH_NODE_VERSION=v1.14.3
ARG PRYSM_VERSION=v5.0.3

# Install dependencies
RUN apt-get update &&\
apt-get install -y --no-install-recommends git git-lfs
RUN apk update &&\
apk add --no-cache \
gcc g++ make musl-dev linux-headers git git-lfs

# Download and set up Prysm binaries
ADD https://github.com/prysmaticlabs/prysm/releases/download/${PRYSM_VERSION}/beacon-chain-${PRYSM_VERSION}-linux-${TARGETARCH} /usr/bin/prysm-beacon
ADD https://github.com/prysmaticlabs/prysm/releases/download/${PRYSM_VERSION}/validator-${PRYSM_VERSION}-linux-${TARGETARCH} /usr/bin/prysm-validator
ADD https://github.com/prysmaticlabs/prysm/releases/download/${PRYSM_VERSION}/prysmctl-${PRYSM_VERSION}-linux-${TARGETARCH} /usr/bin/prysm-ctl
RUN chmod +x /usr/bin/prysm-beacon /usr/bin/prysm-validator /usr/bin/prysm-ctl

WORKDIR /src/geth
WORKDIR /go-ethereum

# Copy and build the Geth source code
COPY . .
RUN go build ./cmd/bootnode && make geth

# Set up final image
FROM ghcr.io/zama-ai/zama-zbc-build:${ZBC_VERSION}
FROM alpine:3.20.3

# Create necessary directories
RUN mkdir -p /val-data /rpc-data /usr/share/devnet-resources /val-data/consensus/beacondata/network-keys

# Copy built binaries and scripts from build
COPY --from=build /src/geth/bootnode /usr/bin/
COPY --from=build /src/geth/build/bin/geth /usr/bin/
COPY --from=build /go-ethereum/bootnode /usr/bin/
COPY --from=build /go-ethereum/build/bin/geth /usr/bin/
COPY --from=build /usr/bin/prysm-beacon /usr/bin/prysm-validator /usr/bin/prysm-ctl /usr/bin/

# Copy config files and scripts
COPY --from=build /src/geth/local-testnet/prep/execution/genesis.json /usr/share/devnet-resources/
COPY --from=build /src/geth/local-testnet/prep/boot.key /usr/share/devnet-resources/
COPY --from=build /src/geth/local-testnet/prep/node1/keystore/ /val-data/keystore/
COPY --from=build /src/geth/local-testnet/prep/consensus/config.yml /usr/share/devnet-resources/consensus-config.yml
COPY --from=build /src/geth/local-testnet/prep/consensus/validator-beacon-static-network-keys /val-data/consensus/beacondata/network-keys
COPY --from=build /src/geth/scripts/run-single-node-devnet.sh /entrypoint.sh
COPY --from=build /src/geth/scripts/faucet.sh /usr/bin/faucet
COPY --from=build /go-ethereum/local-testnet/prep/execution/genesis.json /usr/share/devnet-resources/
COPY --from=build /go-ethereum/local-testnet/prep/boot.key /usr/share/devnet-resources/
COPY --from=build /go-ethereum/local-testnet/prep/node1/keystore/ /val-data/keystore/
COPY --from=build /go-ethereum/local-testnet/prep/consensus/config.yml /usr/share/devnet-resources/consensus-config.yml
COPY --from=build /go-ethereum/local-testnet/prep/consensus/validator-beacon-static-network-keys /val-data/consensus/beacondata/network-keys
COPY --from=build /go-ethereum/scripts/run-single-node-devnet.sh /entrypoint.sh
COPY --from=build /go-ethereum/scripts/faucet.sh /usr/bin/faucet

WORKDIR /

Expand Down

0 comments on commit 1db7476

Please sign in to comment.