-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and push docker images for releases with goreleaser
- Loading branch information
1 parent
f61b582
commit 7ac7dfb
Showing
6 changed files
with
129 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
.env | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/data | ||
/test/data | ||
|
||
# goreleaser output | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
|
||
before: | ||
hooks: | ||
- go mod download | ||
- go generate ./... | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ignore: | ||
- goos: windows | ||
goarch: arm64 | ||
|
||
# Ensure reproducible builds: | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
|
||
flags: | ||
- -trimpath | ||
|
||
ldflags: | ||
# Reduce size: | ||
- -s | ||
- -w | ||
# Embed version | ||
- -X main.version={{.Version}} | ||
|
||
archives: | ||
- name_template: >- | ||
{{ .ProjectName }}- | ||
{{- .Version }}- | ||
{{- .Os }}- | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
format: tar.gz | ||
format_overrides: | ||
# use zip for windows archives | ||
- goos: windows | ||
format: zip | ||
dockers: | ||
- image_templates: | ||
- 'ghcr.io/tfabritius/{{ .ProjectName }}:{{ .Tag }}-amd64' | ||
goarch: amd64 | ||
dockerfile: Dockerfile | ||
use: buildx | ||
build_flag_templates: | ||
- --pull | ||
- --platform=linux/amd64 | ||
- image_templates: | ||
- 'ghcr.io/tfabritius/{{ .ProjectName }}:{{ .Tag }}-arm64' | ||
goarch: arm64 | ||
dockerfile: Dockerfile | ||
use: buildx | ||
build_flag_templates: | ||
- --pull | ||
- --platform=linux/arm64 | ||
|
||
docker_manifests: | ||
- name_template: 'ghcr.io/tfabritius/{{ .ProjectName }}:{{ .Tag }}' | ||
image_templates: | ||
- 'ghcr.io/tfabritius/{{ .ProjectName }}:{{ .Tag }}-amd64' | ||
- 'ghcr.io/tfabritius/{{ .ProjectName }}:{{ .Tag }}-arm64' | ||
- name_template: 'ghcr.io/tfabritius/{{ .ProjectName }}:latest' | ||
image_templates: | ||
- 'ghcr.io/tfabritius/{{ .ProjectName }}:{{ .Tag }}-amd64' | ||
- 'ghcr.io/tfabritius/{{ .ProjectName }}:{{ .Tag }}-arm64' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM gcr.io/distroless/static | ||
|
||
COPY plainpage / | ||
|
||
VOLUME /data | ||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/plainpage"] |