Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: separate docker images for scratch and alpine linux base #106

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,56 @@ archives:

dockers:
- image_templates:
- garethgeorge/backrest:{{ .Tag }}-amd64
dockerfile: Dockerfile
- garethgeorge/backrest:{{ .Tag }}-alpine-amd64
dockerfile: Dockerfile.alpine
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"

- image_templates:
- garethgeorge/backrest:{{ .Tag }}-arm64
- garethgeorge/backrest:{{ .Tag }}-alpine-arm64
dockerfile: Dockerfile.alpine
goarch: arm64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"

- image_templates:
- garethgeorge/backrest:{{ .Tag }}-scratch-arm64
dockerfile: Dockerfile.scratch
goarch: arm64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"

- image_templates:
- garethgeorge/backrest:{{ .Tag }}-scratch-amd64
dockerfile: Dockerfile.scratch
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"

docker_manifests:
- name_template: "garethgeorge/backrest:latest"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-amd64"
- "garethgeorge/backrest:{{ .Tag }}-arm64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- name_template: "garethgeorge/backrest:{{ .Tag }}"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-amd64"
- "garethgeorge/backrest:{{ .Tag }}-arm64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-amd64"
- "garethgeorge/backrest:{{ .Tag }}-scratch-arm64"
- name_template: "garethgeorge/backrest:latest-alpine"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-arm64"
- name_template: "garethgeorge/backrest:{{ .Tag }}-alpine"
image_templates:
- "garethgeorge/backrest:{{ .Tag }}-alpine-amd64"
- "garethgeorge/backrest:{{ .Tag }}-alpine-arm64"

changelog:
sort: asc
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions Dockerfile.scratch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:alpine as gobuild
RUN mkdir /tmp-orig

FROM scratch
COPY --from=gobuild /tmp-orig /tmp
COPY --from=gobuild /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

ENTRYPOINT ["/backrest"]
COPY backrest /backrest
Loading