mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
* generate multiarch images for non-architecture tags * lock docker build to legacy docker buider, and bugfix * rename deploy.sh to deploy_by_arch.sh * Update documentation related to multiarch Docker * Consistent IFS value with respect to other scripts Co-authored-by: humanoid2050 <humanoid2050@monolith> Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
37 lines
1.2 KiB
Bash
Executable File
37 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euxo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
|
|
|
TAG_BASE="$1" # Eg. v0.35.0 or nightly
|
|
if [ -z "$TAG_BASE" ]; then
|
|
echo "We cannot tag Docker images with an empty string!" >&2
|
|
exit 1
|
|
fi
|
|
source "$WORK_DIR/lib/common"
|
|
|
|
# Creates multiarch manifests for TAG_BASE, and 'latest' if TAG_BASE > 2.0.0
|
|
# - certbot/certbot:v2.2.0 <- multiarch manifest
|
|
# - certbot/certbot:latest <- multiarch manifest
|
|
MakeMultiarchManifestForAllTargetArch() {
|
|
DOCKER_REPO="${DOCKER_HUB_ORG}/${1}"
|
|
SRC_IMAGES=()
|
|
for TARGET_ARCH in "${ALL_TARGET_ARCH[@]}"; do
|
|
SRC_IMAGES+=("${DOCKER_REPO}:${TARGET_ARCH}-${TAG_BASE}")
|
|
done
|
|
docker buildx imagetools create -t ${DOCKER_REPO}:${TAG_BASE} "${SRC_IMAGES[@]}"
|
|
if [[ "${TAG_BASE}" =~ ^v([2-9]|[1-9][0-9]+)\.[0-9]+\.[0-9]+$ ]]; then
|
|
docker buildx imagetools create -t ${DOCKER_REPO}:latest "${SRC_IMAGES[@]}"
|
|
fi
|
|
}
|
|
|
|
|
|
# Step 1: Certbot core Docker
|
|
MakeMultiarchManifestForAllTargetArch "certbot"
|
|
|
|
# Step 2: Certbot DNS plugins Docker images
|
|
for plugin in "${CERTBOT_PLUGINS[@]}"; do
|
|
MakeMultiarchManifestForAllTargetArch "${plugin}"
|
|
done
|