Update borg/Dockerfile, borg/Makefile, borg/version, .gitlab-ci.yml files

This commit is contained in:
Adrien le Maire 2021-02-08 11:11:08 +00:00
parent 88d4303396
commit 085ff89a4e
4 changed files with 49 additions and 0 deletions

View File

@ -150,6 +150,17 @@ roundcubemail:
variables: variables:
- $CI_COMMIT_REF_PROTECTED == "true" - $CI_COMMIT_REF_PROTECTED == "true"
borg:
stage: build
tags:
- docker
script:
- cd borg
- make push
only:
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
.docker_init: &docker_init | .docker_init: &docker_init |
if ! docker info &>/dev/null; then if ! docker info &>/dev/null; then
if [ -z "${DOCKER_HOST}" -a "${KUBERNETES_PORT}" ]; then if [ -z "${DOCKER_HOST}" -a "${KUBERNETES_PORT}" ]; then

19
borg/Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM debian:buster-20210111-slim as builder
ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH
RUN apt update -qq && apt upgrade -qqy && rm -rf /var/lib/apt/lists/*
ARG VERSION
RUN case $TARGETARCH in \
arm) \
wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-${VERSION}-armv6 -O /usr/bin/borg \
;; \
arm64) \
wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-${VERSION}-arm64 -O /usr/bin/borg \
;; \
amd64) \
wget https://github.com/borgbackup/borg/releases/download/${VERSION}/borg-linux64 -O /usr/bin/borg \
;; \
esac && \
chmod a+x /usr/bin/borg
FROM debian:buster-20210111-slim
COPY --from=builder /usr/bin/borg /usr/bin/borg

18
borg/Makefile Normal file
View File

@ -0,0 +1,18 @@
NAMESPACE=alemairebe
include version
IMAGE=borg
nopush:
docker buildx build --platform linux/amd64 --load \
--build-arg VERSION=$(VERSION) \
--tag ${NAMESPACE}/${IMAGE}:$(VERSION) \
--tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) .
push:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm --push \
--build-arg VERSION=$(VERSION) \
--cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \
--cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \
--tag ${NAMESPACE}/${IMAGE}:$(VERSION) \
--tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) .

1
borg/version Normal file
View File

@ -0,0 +1 @@
VERSION=1.1.15