Skip to content

Commit

Permalink
Merge pull request #262 from celo-org/bootnode
Browse files Browse the repository at this point in the history
Dockerfileand CI for bootnode
  • Loading branch information
alvarof2 authored Oct 23, 2024
2 parents de410b1 + 6d40179 commit 0ab1443
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/docker-build-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
contents: read

jobs:
build-scan-container:
build-scan-container-geth:
permissions:
contents: read
security-events: write
Expand All @@ -23,3 +23,20 @@ jobs:
context: .
file: Dockerfile
trivy: true

build-scan-container-bootnode:
permissions:
contents: read
security-events: write
id-token: write
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@main
name: Build us-west1-docker.pkg.dev/blockchaintestsglobaltestnet/dev-images/op-geth-bootnode:${{ github.sha }}
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-op-geth/providers/github-by-repos
service-account: 'op-geth-dev@blockchaintestsglobaltestnet.iam.gserviceaccount.com'
artifact-registry: us-west1-docker.pkg.dev/blockchaintestsglobaltestnet/dev-images/op-geth
tags: ${{ github.sha }}
platforms: linux/amd64,linux/arm64
context: .
file: Dockerfile.bootnode
trivy: true
33 changes: 33 additions & 0 deletions Dockerfile.bootnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Support setting various labels on the final image
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

# Build Geth bootnode in a stock Go builder container
FROM golang:1.22-alpine as builder

RUN apk add --no-cache gcc musl-dev linux-headers git

# Get dependencies - will also be cached if we won't change go.mod/go.sum
COPY go.mod /go-ethereum/
COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/bootnode

# Pull Geth bootnode into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/bootnode /usr/local/bin/

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["bootnode"]

# Add some metadata labels to help programmatic image consumption
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"

0 comments on commit 0ab1443

Please sign in to comment.