Skip to content

Commit

Permalink
fix: separate docker images for scratch and alpine linux base (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge authored Feb 19, 2024
1 parent 5a49f2f commit 40e3e04
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
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

0 comments on commit 40e3e04

Please sign in to comment.