mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2024-11-23 13:03:28 +01:00
Fix image tagging problem where latest version is not tagged as litteral
This commit is contained in:
parent
0e7cc38249
commit
d96df7e064
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
WP_VERSIONS=${1:-""}
|
||||
WP_LATEST_VERSION=${2:-""}
|
||||
TARGET_PLATFORMS="linux/amd64,linux/armhf,linux/aarch64"
|
||||
|
||||
CACHE_DIR="/tmp/.buildx-cache"
|
||||
|
||||
|
@ -16,16 +17,18 @@ docker buildx create --use --name build --node build --driver-opt network=host
|
|||
for TARGET_VERSION in ${WP_VERSIONS}; do
|
||||
echo "> Building WordPress ${TARGET_VERSION}"
|
||||
|
||||
IMAGE_TAGS="--tag nlss/wordpress:${TARGET_VERSION}"
|
||||
|
||||
if [ "${TARGET_VERSION}" = "${WP_LATEST_VERSION}" ]; then
|
||||
TARGET_VERSION="latest"
|
||||
IMAGE_TAGS="${IMAGE_TAGS} --tag nlss/wordpress:latest"
|
||||
fi
|
||||
|
||||
docker buildx build \
|
||||
docker buildx build . \
|
||||
--pull \
|
||||
--push \
|
||||
--cache-from "type=local,src=${CACHE_DIR}" \
|
||||
--cache-to "type=local,dest=${CACHE_DIR}" \
|
||||
--build-arg "WP_VERSION=${TARGET_VERSION}" \
|
||||
--platform "linux/amd64,linux/armhf,linux/aarch64" \
|
||||
--tag "nlss/wordpress:${TARGET_VERSION}" .
|
||||
--platform "${TARGET_PLATFORMS}" \
|
||||
${IMAGE_TAGS[@]}
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue
Block a user