Skip to content

Commit

Permalink
Add format docker for s390x builds using podman
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryguy committed Jun 9, 2022
1 parent ee806cf commit a3ddfbe
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ pushd $IMAGE_DIR
cmd+=" --build-arg RELEASE_BUILD=true"
fi

if [ "$ARCH" = "s390x" ]; then
# --format docker is needed to ensure the builds are built with docker v2 manifests
cmd+=" --format docker"
fi

echo "Building manageiq-base: $cmd"
$cmd manageiq-base

Expand All @@ -95,6 +100,12 @@ pushd $IMAGE_DIR
--build-arg FROM_TAG=$TAG \
--build-arg RPM_PREFIX=$RPM_PREFIX \
$image"

if [ "$ARCH" = "s390x" ]; then
# --format docker is needed to ensure the builds are built with docker v2 manifests
cmd+=" --format docker"
fi

echo "Building $image: $cmd"
$cmd
done
Expand All @@ -108,7 +119,21 @@ if [ -z "$NO_OPERATOR" ]; then
cat ./build/_output/BUILD
echo

cmd="operator-sdk build --image-build-args --pull $REPO/manageiq-operator:$TAG"
image_build_args="--image-build-args --pull"
image_builder=""

if [ "$ARCH" = "s390x" ]; then
# HACK: Using buildah as, under the covers, this uses --format docker,
# which is needed to build v2 manifest builds. Normally, we'd pass
# --format docker as above as another arg to image-build-args, however,
# there is a bug in operator-sdk v0.18.2 where it cannot accept multiple
# args in image-build-args.
#
# See also https://github.com/operator-framework/operator-sdk/blob/v0.18.2/cmd/operator-sdk/build/cmd.go#L75-L99
image_builder="--image-builder buildah"
fi

cmd="operator-sdk build $REPO/manageiq-operator:$TAG $image_build_args $image_builder"
echo "Building manageiq-operator: $cmd"
$cmd
popd
Expand Down

0 comments on commit a3ddfbe

Please sign in to comment.