Skip building buscribe under arm64

Also handle not setting MULTIPLATFORM properly
HubbeKing-multiplatform-builds
Hubbe 6 days ago committed by GitHub
parent 61a6ccff0f
commit 8a79d0977f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

59
build

@ -73,42 +73,51 @@ fi
for component in "${COMPONENTS[@]}"; do
echo "Building image for $component"
if [ -n "$MULTIPLATFORM" ]; then
echo "Creating multi-arch manifest"
"$BUILD_CMD" manifest create "wubloader-$component"
fi
latest="$BASE/wubloader-$component:latest"
specific="$BASE/wubloader-$component:$TAG"
# no way to build multi-arch in parallel, so just build amd64 first and then arm64.
# caching should work with both, so that'll make things less painful at least.
"$BUILD_CMD" build \
-f "$component/Dockerfile" \
-t "$latest" \
-t "$specific" \
--manifest "wubloader-$component" \
--arch amd64 \
"${CACHE_ARGS[@]}" \
.
"$BUILD_CMD" build \
-f "$component/Dockerfile" \
-t "$latest" \
-t "$specific" \
--manifest "wubloader-$component" \
--arch arm64 \
"${CACHE_ARGS[@]}" \
.
echo "Built image wubloader-$component:$TAG"
if [ -n "$MULTIPLATFORM" ]; then
echo "Creating multi-arch manifest"
"$BUILD_CMD" manifest create "wubloader-$component"
# no way to build multi-arch in parallel, so just build amd64 first and then arm64.
# caching should work with both, so that'll make things less painful at least.
"$BUILD_CMD" build \
-f "$component/Dockerfile" \
-t "$latest" \
-t "$specific" \
--manifest "wubloader-$component" \
--arch amd64 \
"${CACHE_ARGS[@]}" \
.
# buscribe doesn't (yet?) build under arm64 due to pulling in libc-bin, skip arm64 for it
if [ "$component" != "buscribe ]; then
"$BUILD_CMD" build \
-f "$component/Dockerfile" \
-t "$latest" \
-t "$specific" \
--manifest "wubloader-$component" \
--arch arm64 \
"${CACHE_ARGS[@]}" \
.
fi
echo "Built image wubloader-$component:$TAG"
# manifest pushes are buildah-specific. docker buildx multiplatform builds have different syntax...
if [ -n "$PUSH" ]; then
echo "Pushing tag $specific"
"$BUILD_CMD" manifest push --all "docker://$specific"
"$BUILD_CMD" manifest push --all "$specific"
fi
if [ "$PUSH" == "latest" ]; then
echo "Pushing tag $latest"
"$BUILD_CMD" manifest push --all "docker://$latest"
"$BUILD_CMD" manifest push --all "$latest"
fi
else
"$BUILD_CMD" build \
-f "$component/Dockerfile" \
-t "$latest" \
-t "$specific" \
--manifest "wubloader-$component" \
"${CACHE_ARGS[@]}" \
.
echo "Built image wubloader-$component:$TAG"
if [ -n "$PUSH" ]; then
echo "Pushing tag $specific"
"$BUILD_CMD" push "$specific"

Loading…
Cancel
Save