diff --git a/build-bin/docker/configure_docker_push b/build-bin/docker/configure_docker_push index 149ff90..196e302 100755 --- a/build-bin/docker/configure_docker_push +++ b/build-bin/docker/configure_docker_push @@ -13,7 +13,7 @@ # the License. # -# Ensures Docker is logged in, buildx is available and it can build multi-architecture. +# Ensures Docker is logged in and it can build multi-architecture. # This should be used instead of `configure_docker` when a push will occur. # # This should only happen when we are publishing multi-arch builds, as otherwise the setup could use @@ -32,7 +32,7 @@ fi echo '{ "experimental":true, "registry-mirrors": ["https://mirror.gcr.io"] }' | sudo tee /etc/docker/daemon.json sudo service docker restart -# Enable experimental client features (eg docker buildx) +# Enable experimental client features (multi-arch) mkdir -p ${HOME}/.docker && echo '{"experimental":"enabled"}' > ${HOME}/.docker/config.json # Log in to GitHub Container Registry and Docker Hub for releasing images diff --git a/build-bin/docker/docker_arch b/build-bin/docker/docker_arch index 1d86236..c668e69 100755 --- a/build-bin/docker/docker_arch +++ b/build-bin/docker/docker_arch @@ -20,24 +20,24 @@ set -ue -# Normalize arch to what's available -arch=${ARCH:-$(uname -m)} -case ${arch} in +# Normalize docker_arch to what's available +docker_arch=${DOCKER_ARCH:-$(uname -m)} +case ${docker_arch} in amd64* ) - arch=amd64 + docker_arch=amd64 ;; x86_64* ) - arch=amd64 + docker_arch=amd64 ;; arm64* ) - arch=arm64 + docker_arch=arm64 ;; aarch64* ) - arch=arm64 + docker_arch=arm64 ;; * ) - >&2 echo "Unsupported arch: ${arch}" + >&2 echo "Unsupported DOCKER_ARCH: ${docker_arch}" exit 1; esac -echo ${arch} +echo ${docker_arch} diff --git a/build-bin/docker/docker_build b/build-bin/docker/docker_build index 9f52d7c..98c8e78 100755 --- a/build-bin/docker/docker_build +++ b/build-bin/docker/docker_build @@ -19,7 +19,8 @@ docker_tag=${1?full docker_tag is required. Ex openzipkin/zipkin:test} version=${2:-} docker_args=$($(dirname "$0")/docker_args ${version}) -# Avoid buildx on load for two reasons: +# Avoid buildx on load for reasons including: +# * Caching is more complex as builder instances must be considered # * It only supports one platform/arch on load https://github.com/docker/buildx/issues/59 # * It would pull Docker Hub for moby/buildkit or multiarch/qemu-user-static images, using up quota echo "Building image ${docker_tag}" diff --git a/build-bin/docker/docker_push b/build-bin/docker/docker_push index 3d1f196..e4a3223 100755 --- a/build-bin/docker/docker_push +++ b/build-bin/docker/docker_push @@ -18,7 +18,11 @@ # When a release, and DOCKER_RELEASE_REPOS is unset they also push to Docker Hub (docker.io). # # Note: In CI, `configure_docker_push` must be called before invoking this. - +# +# Avoid buildx on push for reasons including: +# * Caching is more complex as builder instances must be considered +# * Platform builds run in parallel, leading to port conflict failures (ex in cassandra) +# * 0.4.2 multi-platform builds have failed due to picking the wrong image for a FROM instruction set -ue docker_image=${1?docker_image is required, notably without a tag. Ex openzipkin/zipkin} @@ -60,7 +64,7 @@ for repo in ${docker_repos}; do done docker_args=$($(dirname "$0")/docker_args ${version}) -docker_archs=${DOCKER_PLATFORMS:-amd64 arm64} +docker_archs=${DOCKER_ARCHS:-amd64 arm64} echo "Will build the following architectures: ${docker_archs}"