Skip to content

Commit

Permalink
Merge pull request #90 from 0xPolygon/goreleaser-dockerfile
Browse files Browse the repository at this point in the history
goreleaser dockerfile
  • Loading branch information
vcastellm authored Feb 28, 2024
2 parents 4303175 + 2c3e12a commit 7376bc5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.21

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
12 changes: 9 additions & 3 deletions .goreleaser-cdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ release:
draft: true
prerelease: auto

before:
hooks:
- go mod download
- go install github.com/gobuffalo/packr/v2/[email protected]
- ( cd db && packr2 )

builds:
- main: ./cmd/
binary: zkevm-node
binary: dist/zkevm-node
goos:
- linux
- darwin
Expand All @@ -32,7 +38,7 @@ archives:
dockers:
- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ replace .Version "+" "-" }}-amd64
dockerfile: Dockerfile
dockerfile: Dockerfile.release
use: buildx
goos: linux
goarch: amd64
Expand All @@ -49,7 +55,7 @@ dockers:

- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ replace .Version "+" "-" }}-arm64
dockerfile: Dockerfile
dockerfile: Dockerfile.release
use: buildx
goos: linux
goarch: arm64
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:3.18

COPY dist/zkevm-node /app/zkevm-node

EXPOSE 8123

RUN addgroup -S zkevm-group \
&& adduser -S zkevm-user -G zkevm-group

RUN chown -R /app zkevm-user:zkevm-group

USER zkevm-user

CMD ["/bin/sh", "-c", "/app/zkevm-node"]

0 comments on commit 7376bc5

Please sign in to comment.