fix: add --amend to docker manifest create for :latest tags, remove debug
:latest manifests already exist from the first successful run (build 123), so subsequent docker manifest create without --amend fails with 'refusing to amend an existing manifest list'. Add --amend so every pipeline run can update the :latest tag. Also remove DEBUG config.json prints now that the auth path is verified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
+5
-6
@@ -161,7 +161,6 @@ pipeline {
|
||||
# login entirely) — then push with fresh baked-in credentials.
|
||||
AUTH_B64=\$(printf '%s:%s' "\$DOCKER_USERNAME" "\$DOCKER_PASSWORD" | base64 -w0)
|
||||
printf '{"auths":{"%s":{"auth":"%s"}}}' "${REGISTRY_URL}" "\$AUTH_B64" | sudo tee /root/.docker/config.json >/dev/null
|
||||
echo "DEBUG config:" && sudo cat /root/.docker/config.json
|
||||
sudo docker push "\$PLAT_REF" 2>&1 | tail -5
|
||||
sudo docker push "\$PLAT_LATEST" 2>&1 | tail -5
|
||||
|
||||
@@ -171,11 +170,11 @@ pipeline {
|
||||
|
||||
echo ''
|
||||
echo "=== Creating multi-arch manifest: ${API_IMAGE_TAGGED} ==="
|
||||
AUTH_B64=\$(printf '%s:%s' "\$DOCKER_USERNAME" "\$DOCKER_PASSWORD" | base64 -w0) && printf '{"auths":{"%s":{"auth":"%s"}}}' "${REGISTRY_URL}" "\$AUTH_B64" | sudo tee /root/.docker/config.json >/dev/null && echo "[config written]"
|
||||
AUTH_B64=\$(printf '%s:%s' "\$DOCKER_USERNAME" "\$DOCKER_PASSWORD" | base64 -w0) && printf '{"auths":{"%s":{"auth":"%s"}}}' "${REGISTRY_URL}" "\$AUTH_B64" | sudo tee /root/.docker/config.json >/dev/null
|
||||
sudo docker manifest create "${API_IMAGE_TAGGED}" \
|
||||
"${API_IMAGE_TAGGED}-amd64" \
|
||||
"${API_IMAGE_TAGGED}-arm64"
|
||||
sudo docker manifest create "${API_IMAGE_LATEST}" \
|
||||
sudo docker manifest create --amend "${API_IMAGE_LATEST}" \
|
||||
"${API_IMAGE_LATEST}-amd64" \
|
||||
"${API_IMAGE_LATEST}-arm64"
|
||||
|
||||
@@ -271,7 +270,7 @@ pipeline {
|
||||
frontend
|
||||
|
||||
echo "=== Pushing \$PLAT_REF ==="
|
||||
AUTH_B64=\$(printf '%s:%s' "\$DOCKER_USERNAME" "\$DOCKER_PASSWORD" | base64 -w0) && printf '{"auths":{"%s":{"auth":"%s"}}}' "${REGISTRY_URL}" "\$AUTH_B64" | sudo tee /root/.docker/config.json >/dev/null && echo "[config written]"
|
||||
AUTH_B64=\$(printf '%s:%s' "\$DOCKER_USERNAME" "\$DOCKER_PASSWORD" | base64 -w0) && printf '{"auths":{"%s":{"auth":"%s"}}}' "${REGISTRY_URL}" "\$AUTH_B64" | sudo tee /root/.docker/config.json >/dev/null
|
||||
sudo docker push "\$PLAT_REF" 2>&1 | tail -3
|
||||
sudo docker push "\$PLAT_LATEST" 2>&1 | tail -3
|
||||
sudo docker rmi "\$PLAT_REF" "\$PLAT_LATEST" 2>/dev/null || true
|
||||
@@ -279,11 +278,11 @@ pipeline {
|
||||
|
||||
echo ''
|
||||
echo "=== Creating multi-arch manifest: ${WEB_IMAGE_TAGGED} ==="
|
||||
AUTH_B64=\$(printf '%s:%s' "\$DOCKER_USERNAME" "\$DOCKER_PASSWORD" | base64 -w0) && printf '{"auths":{"%s":{"auth":"%s"}}}' "${REGISTRY_URL}" "\$AUTH_B64" | sudo tee /root/.docker/config.json >/dev/null && echo "[config written]"
|
||||
AUTH_B64=\$(printf '%s:%s' "\$DOCKER_USERNAME" "\$DOCKER_PASSWORD" | base64 -w0) && printf '{"auths":{"%s":{"auth":"%s"}}}' "${REGISTRY_URL}" "\$AUTH_B64" | sudo tee /root/.docker/config.json >/dev/null
|
||||
sudo docker manifest create "${WEB_IMAGE_TAGGED}" \
|
||||
"${WEB_IMAGE_TAGGED}-amd64" \
|
||||
"${WEB_IMAGE_TAGGED}-arm64"
|
||||
sudo docker manifest create "${WEB_IMAGE_LATEST}" \
|
||||
sudo docker manifest create --amend "${WEB_IMAGE_LATEST}" \
|
||||
"${WEB_IMAGE_LATEST}-amd64" \
|
||||
"${WEB_IMAGE_LATEST}-arm64"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user