From 9bc161c1404cecabe9191bd5d7373ca2b21be0e0 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 18 Feb 2020 22:47:51 +0100 Subject: [PATCH] split the manifest step into a separate skript --- build.sh | 6 +----- docker/env | 5 +++++ manifest.sh | 15 +++++++++++++++ push.sh | 23 ++--------------------- 4 files changed, 23 insertions(+), 26 deletions(-) create mode 100644 docker/env create mode 100755 manifest.sh diff --git a/build.sh b/build.sh index 208d49a..cbeff6f 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,6 @@ #!/bin/bash set -euxo pipefail - -ARCH=$(uname -m) - -TAG=${TAG:-"latest"} -ARCHTAG="$TAG-$ARCH" +. docker/env docker build --pull -t openwebrx-base:$ARCHTAG -f docker/Dockerfiles/Dockerfile-base . docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-rtlsdr:$ARCHTAG -f docker/Dockerfiles/Dockerfile-rtlsdr . diff --git a/docker/env b/docker/env new file mode 100644 index 0000000..af1b7f6 --- /dev/null +++ b/docker/env @@ -0,0 +1,5 @@ +ARCH=$(uname -m) +IMAGES="openwebrx-rtlsdr openwebrx-sdrplay openwebrx-hackrf openwebrx-airspy openwebrx-rtlsdr-soapy openwebrx-plutosdr openwebrx-limesdr openwebrx-soapyremote openwebrx-full openwebrx" +ALL_ARCHS="x86_64 armv7l aarch64" +TAG=${TAG:-"latest"} +ARCHTAG="$TAG-$ARCH" diff --git a/manifest.sh b/manifest.sh new file mode 100755 index 0000000..5d5160b --- /dev/null +++ b/manifest.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euxo pipefail +. docker/env + +for image in ${IMAGES}; do + # there's no docker manifest rm command, and the create --amend does not work, so we have to clean up manually + rm -rf "${HOME}/.docker/manifests/docker.io_jketterl_${image}-${TAG}" + IMAGE_LIST="" + for a in $ALL_ARCHS; do + IMAGE_LIST="$IMAGE_LIST jketterl/$image:$TAG-$a" + done + docker manifest create jketterl/$image:$TAG $IMAGE_LIST + docker manifest push --purge jketterl/$image:$TAG + docker pull jketterl/$image:$TAG +done diff --git a/push.sh b/push.sh index fdc31c8..bca5cca 100755 --- a/push.sh +++ b/push.sh @@ -1,26 +1,7 @@ #!/bin/bash set -euxo pipefail - -ARCH=$(uname -m) - -ALL_ARCHS="x86_64 armv7l aarch64" -TAG=${TAG:-"latest"} -ARCHTAG="$TAG-$ARCH" - -IMAGES="openwebrx-rtlsdr openwebrx-sdrplay openwebrx-hackrf openwebrx-airspy openwebrx-rtlsdr-soapy openwebrx-plutosdr openwebrx-limesdr openwebrx-soapyremote openwebrx-full openwebrx" +. docker/env for image in ${IMAGES}; do docker push jketterl/$image:$ARCHTAG -done - -for image in ${IMAGES}; do - # there's no docker manifest rm command, and the create --amend does not work, so we have to clean up manually - rm -rf "${HOME}/.docker/manifests/docker.io_jketterl_${image}-${TAG}" - IMAGE_LIST="" - for a in $ALL_ARCHS; do - IMAGE_LIST="$IMAGE_LIST jketterl/$image:$TAG-$a" - done - docker manifest create jketterl/$image:$TAG $IMAGE_LIST - docker manifest push --purge jketterl/$image:$TAG - docker pull jketterl/$image:$TAG -done +done \ No newline at end of file