-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate multiarch images for non-architecture tags (#9586)
* 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>
- Loading branch information
1 parent
1cb48ec
commit a42cffc
Showing
6 changed files
with
94 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/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 |