Skip to content

Commit

Permalink
Build container with all tools on alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortejoso authored Jan 11, 2025
1 parent 89a7400 commit 75db7b6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-sign-commit-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,32 @@ jobs:
push: ${{ fromJSON(true) }}
trivy: ${{ fromJSON(true) }}

build-container-geth-all-sha:
runs-on: [self-hosted, blockchain, 8-cpu]
permissions:
contents: read
id-token: write
security-events: write
steps:
- uses: actions/checkout@v4
- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/[email protected]
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
service-account: '[email protected]'
docker-gcp-registries: us-west1-docker.pkg.dev
- name: Build and push container
uses: celo-org/reusable-workflows/.github/actions/[email protected]
with:
platforms: linux/amd64
registry: us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-all
tags: ${{ github.sha }}
context: .
dockerfile: Dockerfile.alltools
push: ${{ fromJSON(true) }}
trivy: ${{ fromJSON(true) }}


build-container-geth-master:
runs-on: [self-hosted, blockchain, 8-cpu]
if: github.ref == 'refs/heads/master'
Expand Down
21 changes: 7 additions & 14 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
# Build Geth in a stock Go builder container
FROM golang:1.19-bookworm as builder
FROM golang:1.19-alpine as builder

RUN headers_package="linux-headers-$(dpkg --print-architecture)" && \
apt update && \
apt install -y build-essential git musl-dev $headers_package
RUN apk add --no-cache make gcc musl-dev linux-headers git

ADD . /go-ethereum
RUN cd /go-ethereum && make all-musl

# Pull all binaries into a second stage deploy alpine container
FROM debian:bookworm
# Pull Geth into a second stage deploy alpine container
FROM alpine:latest
ARG COMMIT_SHA

RUN apt update &&\
apt install -y ca-certificates wget &&\
rm -rf /var/cache/apt &&\
rm -rf /var/lib/apt/lists/* &&\
ln -sf /bin/bash /bin/sh

RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
RUN echo $COMMIT_SHA > /version.txt
ADD scripts/run_geth_in_docker.sh /

EXPOSE 8545 8546 30303 30303/udp

Expand All @@ -28,5 +22,4 @@ ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

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

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

0 comments on commit 75db7b6

Please sign in to comment.