|
|
@ -73,12 +73,11 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
for component in "${COMPONENTS[@]}"; do
|
|
|
|
for component in "${COMPONENTS[@]}"; do
|
|
|
|
echo "Building image for $component"
|
|
|
|
echo "Building image for $component"
|
|
|
|
|
|
|
|
latest="$BASE/wubloader-$component:latest"
|
|
|
|
|
|
|
|
specific="$BASE/wubloader-$component:$TAG"
|
|
|
|
if [ -n "$MULTIPLATFORM" ]; then
|
|
|
|
if [ -n "$MULTIPLATFORM" ]; then
|
|
|
|
echo "Creating multi-arch manifest"
|
|
|
|
echo "Creating multi-arch manifest"
|
|
|
|
"$BUILD_CMD" manifest create "wubloader-$component"
|
|
|
|
"$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.
|
|
|
|
# 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.
|
|
|
|
# caching should work with both, so that'll make things less painful at least.
|
|
|
|
"$BUILD_CMD" build \
|
|
|
|
"$BUILD_CMD" build \
|
|
|
@ -89,6 +88,8 @@ for component in "${COMPONENTS[@]}"; do
|
|
|
|
--arch amd64 \
|
|
|
|
--arch amd64 \
|
|
|
|
"${CACHE_ARGS[@]}" \
|
|
|
|
"${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 \
|
|
|
|
"$BUILD_CMD" build \
|
|
|
|
-f "$component/Dockerfile" \
|
|
|
|
-f "$component/Dockerfile" \
|
|
|
|
-t "$latest" \
|
|
|
|
-t "$latest" \
|
|
|
@ -97,18 +98,26 @@ for component in "${COMPONENTS[@]}"; do
|
|
|
|
--arch arm64 \
|
|
|
|
--arch arm64 \
|
|
|
|
"${CACHE_ARGS[@]}" \
|
|
|
|
"${CACHE_ARGS[@]}" \
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
fi
|
|
|
|
echo "Built image wubloader-$component:$TAG"
|
|
|
|
echo "Built image wubloader-$component:$TAG"
|
|
|
|
if [ -n "$MULTIPLATFORM" ]; then
|
|
|
|
|
|
|
|
# manifest pushes are buildah-specific. docker buildx multiplatform builds have different syntax...
|
|
|
|
# manifest pushes are buildah-specific. docker buildx multiplatform builds have different syntax...
|
|
|
|
if [ -n "$PUSH" ]; then
|
|
|
|
if [ -n "$PUSH" ]; then
|
|
|
|
echo "Pushing tag $specific"
|
|
|
|
echo "Pushing tag $specific"
|
|
|
|
"$BUILD_CMD" manifest push --all "docker://$specific"
|
|
|
|
"$BUILD_CMD" manifest push --all "$specific"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$PUSH" == "latest" ]; then
|
|
|
|
if [ "$PUSH" == "latest" ]; then
|
|
|
|
echo "Pushing tag $latest"
|
|
|
|
echo "Pushing tag $latest"
|
|
|
|
"$BUILD_CMD" manifest push --all "docker://$latest"
|
|
|
|
"$BUILD_CMD" manifest push --all "$latest"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
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
|
|
|
|
if [ -n "$PUSH" ]; then
|
|
|
|
echo "Pushing tag $specific"
|
|
|
|
echo "Pushing tag $specific"
|
|
|
|
"$BUILD_CMD" push "$specific"
|
|
|
|
"$BUILD_CMD" push "$specific"
|
|
|
|