From 07befda44dd45204a1cd663ce9375a1c91b7bb6e Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Thu, 1 Jul 2021 15:16:39 +0200 Subject: [PATCH] build mc from source, support arm/v7 --- .circleci/config.yml | 2 +- Dockerfile | 12 +++++++----- README.md | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index adb36bd..5470420 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,7 @@ jobs: docker context create docker-volume-backup docker buildx create docker-volume-backup --name docker-volume-backup --use docker buildx inspect --bootstrap - docker buildx build --platform linux/arm64,linux/amd64 \ + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \ -t offen/docker-volume-backup:$CIRCLE_TAG \ -t offen/docker-volume-backup:latest \ . --push diff --git a/Dockerfile b/Dockerfile index 4223f32..dc9540e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,9 @@ # Copyright 2021 - Offen Authors -# SPDX-License-Identifier: MIT +# SPDX-License-Identifier: MPL-2.0 + +FROM golang:1.16-alpine as builder +ARG MC_VERSION=RELEASE.2021-06-13T17-48-22Z +RUN go install github.com/minio/mc@$MC_VERSION FROM alpine:3.14 @@ -9,10 +13,8 @@ RUN apk add --update ca-certificates docker openrc gnupg RUN update-ca-certificates RUN rc-update add docker boot -ARG TARGETARCH=amd64 -RUN wget https://dl.min.io/client/mc/release/linux-$TARGETARCH/mc && \ - chmod +x mc && \ - mv mc /usr/bin/mc +COPY --from=builder /go/bin/mc /usr/bin/mc +RUN mc --version COPY src/backup.sh src/entrypoint.sh /root/ RUN chmod +x backup.sh && mv backup.sh /usr/bin/backup \ diff --git a/README.md b/README.md index d6d1c5e..ef8b6c4 100644 --- a/README.md +++ b/README.md @@ -114,4 +114,4 @@ This image is heavily inspired by the `futurice/docker-volume-backup`. We decide - This image makes use of the MinIO client `mc` instead of the full blown AWS CLI for uploading backups. - The original image proposed to handle backup rotation through AWS S3 lifecycle policies. This image adds the option to rotate old backups through the same script so this functionality can also be offered for non-AWS storage backends like MinIO. - InfluxDB specific functionality was removed. -- `arm64` Architecture is supported. +- `arm64` and `arm/v7` architectures are supported.