Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build multiarch (amd64 and arm64) images #1512

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions build/tools/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,21 @@ function build_cli_for_all() {

function build_oci() {
local tag_prefix=$1
local os=linux
local arch=amd64
local os=$2
local arch=$3

docker build --platform $os/$arch --build-arg NOOBAA_BIN_PATH=$(generate_full_bin_path $os $arch) -t $tag_prefix/noobaa-operator:$(get_noobaa_version) -f build/Dockerfile .
docker build --platform $os/$arch --build-arg NOOBAA_BIN_PATH=$(generate_full_bin_path $os $arch) -t $tag_prefix/noobaa-operator:${os}-${arch}-$(get_noobaa_version) -f build/Dockerfile .
}

function build_oci_for_all() {
local repository=$1
build_oci "${repository}" linux amd64
build_oci "${repository}" linux arm64

local version=$(get_noobaa_version)
docker manifest create "${repository}/noobaa-operator:${version}" \
--amend "${repository}/noobaa-operator:linux-amd64-${version}" \
--amend "${repository}/noobaa-operator:linux-arm64-${version}"
}

function generate_krew_manifest() {
Expand Down Expand Up @@ -209,7 +220,7 @@ function generate_operator_bundle() {
function main() {
check_deps "${dependencies[@]}"
build_cli_for_all
build_oci ${OCI_ORG:-noobaa}
build_oci_for_all ${OCI_ORG:-noobaa}
generate_krew_manifest
generate_homebrew_formula
generate_operator_bundle
Expand Down
4 changes: 2 additions & 2 deletions build/tools/releaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ function create_oci_release() {
echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin

echo "Pushing the images to docker.io..."
docker push $docker_image
docker manifest push $docker_image

echo "Logging in to quay.io..."
echo "$QUAY_TOKEN" | docker login -u "$QUAY_USERNAME" --password-stdin quay.io

echo "Pushing the images to quay.io..."
docker push $quay_image
docker manifest push $quay_image
}

function create_krew() {
Expand Down
Loading