Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
docker: add debug image
Browse files Browse the repository at this point in the history
  • Loading branch information
islishude committed Feb 14, 2024
1 parent 170bb6e commit 6bbada7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
10 changes: 8 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
interval: weekly
groups:
actions:
patterns: ["*"]

- package-ecosystem: docker
directory: /
schedule:
interval: daily
interval: weekly
groups:
docker:
patterns: ["*"]
37 changes: 24 additions & 13 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4

- name: Install cosign
if: ${{ github.ref_type == 'tag' }}
uses: sigstore/cosign-installer@v3

- name: Login to Github Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
Expand All @@ -53,22 +49,37 @@ jobs:
type=semver,pattern={{version}}
type=ref,event=branch
- name: Build with tag and push
id: docker-build-push
- name: Build
uses: docker/build-push-action@v5
with:
push: ${{ github.ref_type == 'tag' }}
push: true
pull: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}
annotations: ${{ steps.docker-meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
target: latest

- name: Docker meta for debug target
id: docker-meta-debug
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},suffix=debug
type=ref,event=branch,suffix=debug
- name: Sign the published Docker image
if: ${{ github.ref_type == 'tag' }}
env:
TAGS: ${{ steps.docker-meta.outputs.tags }}
DIGEST: ${{ steps.docker-build-push.outputs.digest }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
- name: Build debug
uses: docker/build-push-action@v5
with:
push: true
pull: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker-meta-debug.outputs.tags }}
labels: ${{ steps.docker-meta-debug.outputs.labels }}
annotations: ${{ steps.docker-meta-debug.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
target: debug
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ ARG VERSION=v1.13.12
RUN git clone --quiet --branch ${VERSION} --depth 1 https://github.com/ethereum/go-ethereum .
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go run build/ci.go install -static ./cmd/geth

FROM gcr.io/distroless/base-debian12:latest
FROM gcr.io/distroless/base-debian12:latest as latest
COPY --from=BUILDER /geth/build/bin/geth /usr/local/bin/
EXPOSE 8545 8546 8551 30303 30303/udp
USER 65532
ENTRYPOINT ["geth"]

FROM alpine:3.19.1 as debug
COPY --from=BUILDER /geth/build/bin/geth /usr/local/bin/
ENTRYPOINT ["geth"]

0 comments on commit 6bbada7

Please sign in to comment.