Skip to content

Commit

Permalink
feat: add rclone binary to docker image and arm64 support (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge authored Feb 19, 2024
1 parent 147feb4 commit 5a49f2f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -31,7 +34,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: build --snapshot --clean
args: release --snapshot --clean

- name: Test
run: PATH=$(pwd):$PATH go test ./...
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
Expand Down
26 changes: 24 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,30 @@ archives:

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

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

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

changelog:
sort: asc
Expand Down
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
FROM golang:alpine as gobuild
RUN mkdir /tmp-orig
COPY backrest /backrest

FROM rclone/rclone:1.65 as rclone

FROM alpine:latest
COPY --from=gobuild /tmp-orig /tmp
COPY --from=rclone /usr/local/bin/rclone /usr/local/bin/rclone
RUN apk --no-cache add ca-certificates bash curl
RUN apk --no-cache add ca-certificates curl bash
RUN mkdir -p /tmp

ENTRYPOINT ["/backrest"]
COPY backrest /backrest
8 changes: 0 additions & 8 deletions Dockerfile.example

This file was deleted.

0 comments on commit 5a49f2f

Please sign in to comment.