forked from kontena/akrobateo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiarch.sh
executable file
·36 lines (28 loc) · 1.1 KB
/
multiarch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -ue
SRC_REPO="docker://quay.io/kontena"
DST_REPO="docker://docker.io/kontenapharos"
# This script is only invoked in CI on tag and master push
TAG=${DRONE_TAG:-"latest"}
TAG=${TAG#v}
create_list() {
local image=$1
local version=$2
local platforms=$3
local docker_creds=(${DOCKER_CREDS//:/ })
manifest-tool --username ${docker_creds[0]} --password ${docker_creds[1]} push from-args \
--platforms $platforms --template "docker.io/kontenapharos/${image}-ARCH:${version}" \
--target "docker.io/kontenapharos/${image}:${version}"
}
archs=(amd64 arm64)
for ARCH in "${archs[@]}"
do
image="akrobateo-lb-${ARCH}:${TAG}"
echo "Starting to sync image ${image} ..."
skopeo --override-arch=${ARCH} copy --dest-creds="${DOCKER_CREDS}" "${SRC_REPO}/${image}" "${DST_REPO}/${image}"
image="akrobateo-${ARCH}:${TAG}"
skopeo --override-arch=${ARCH} copy --dest-creds="${DOCKER_CREDS}" "${SRC_REPO}/${image}" "${DST_REPO}/${image}"
done
platforms="linux/amd64,linux/arm64"
create_list "akrobateo-lb" "${TAG}" $platforms
create_list "akrobateo" "${TAG}" $platforms