mirror of
https://github.com/ViViDboarder/docker-restic-cron.git
synced 2024-11-23 05:36:38 +00:00
Add multi-arch builds
This commit is contained in:
parent
fd148ac502
commit
69e113ff3f
@ -1,5 +1,6 @@
|
||||
FROM ubuntu:bionic
|
||||
MAINTAINER ViViDboarder <vividboarder@gmail.com>
|
||||
ARG REPO=library
|
||||
FROM ${REPO}/ubuntu:bionic
|
||||
LABEL maintainer="ViViDboarder <vividboarder@gmail.com>"
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
|
2
Makefile
2
Makefile
@ -12,7 +12,7 @@ build-x86:
|
||||
|
||||
.PHONY: build-arm
|
||||
build-arm:
|
||||
docker build -f ./Dockerfile -t $(DOCKER_TAG) .
|
||||
docker build --build-arg REPO=arm32v7 -f ./Dockerfile -t $(DOCKER_TAG)-arm32v7 .
|
||||
|
||||
.PHONY: build-all
|
||||
build-all: build-x86 build-arm
|
||||
|
38
hooks/build
Executable file
38
hooks/build
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Extract arch repo from a docker tag suffix
|
||||
REPO=""
|
||||
case "$DOCKER_TAG" in
|
||||
*amd64)
|
||||
REPO="library"
|
||||
;;
|
||||
*arm32v5)
|
||||
REPO="arm32v5"
|
||||
;;
|
||||
*arm32v6)
|
||||
REPO="arm32v6"
|
||||
;;
|
||||
*arm32v7)
|
||||
REPO="arm32v7"
|
||||
;;
|
||||
*arm64v8)
|
||||
REPO="arm64v8"
|
||||
;;
|
||||
*i386)
|
||||
REPO="i386"
|
||||
;;
|
||||
*ppc64le)
|
||||
REPO="ppc64le"
|
||||
;;
|
||||
*s390x)
|
||||
REPO="s390x"
|
||||
;;
|
||||
*)
|
||||
REPO="library"
|
||||
;;
|
||||
esac
|
||||
|
||||
docker build \
|
||||
--build-arg REPO="$REPO" \
|
||||
--tag "$IMAGE_NAME" .
|
9
hooks/post_push
Executable file
9
hooks/post_push
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Use manifest-tool to create the manifest, given the experimental
|
||||
# "docker manifest" command isn't available yet on Docker Hub.
|
||||
|
||||
curl -Lo manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.9.0/manifest-tool-linux-amd64
|
||||
chmod +x manifest-tool
|
||||
|
||||
./manifest-tool push from-spec multi-arch-manifest.yml
|
39
hooks/pre_build
Executable file
39
hooks/pre_build
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
REPO=""
|
||||
case "$DOCKER_TAG" in
|
||||
*amd64)
|
||||
REPO="library"
|
||||
;;
|
||||
*arm32v5)
|
||||
REPO="arm32v5"
|
||||
;;
|
||||
*arm32v6)
|
||||
REPO="arm32v6"
|
||||
;;
|
||||
*arm32v7)
|
||||
REPO="arm32v7"
|
||||
;;
|
||||
*arm64v8)
|
||||
REPO="arm64v8"
|
||||
;;
|
||||
*i386)
|
||||
REPO="i386"
|
||||
;;
|
||||
*ppc64le)
|
||||
REPO="ppc64le"
|
||||
;;
|
||||
*s390x)
|
||||
REPO="s390x"
|
||||
;;
|
||||
*)
|
||||
REPO="library"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
[ "${REPO}" != "library" ] && \
|
||||
{ echo 'qemu-user-static: Registration not required for current arch'; exit 0; }
|
||||
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
17
multi-arch-manifest.yml
Normal file
17
multi-arch-manifest.yml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
image: vividboarder/docker-restic-cron:latest
|
||||
manifests:
|
||||
- image: vividboarder/docker-restic-cron:amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
- image: vividboarder/docker-restic-cron:arm32v7
|
||||
platform:
|
||||
architecture: arm
|
||||
os: linux
|
||||
variant: v7
|
||||
- image: vividboarder/docker-restic-cron:arm64v8
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
||||
variant: v8
|
Loading…
Reference in New Issue
Block a user