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

PMM-9242 ARM build for PMM Client v3 #3022

Closed
wants to merge 6 commits into from
Closed
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
29 changes: 20 additions & 9 deletions build/scripts/build-client-docker
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -o xtrace

. $(dirname $0)/vars

ARCH=${ARCH:-arm64}

if [ -f "${docker_client_tarball}" ]; then
echo skip docker build
exit 0
Expand All @@ -17,22 +19,31 @@ if [ -z "${DOCKER_CLIENT_TAG}" ]; then
DOCKER_CLIENT_TAG=perconalab/pmm-client-fb:${full_pmm_version}
fi


CLIENT_IMAGE_VERSION=`echo $DOCKER_CLIENT_TAG | cut -d ':' -f2`

docker build --build-arg BUILD_DATE="`date --rfc-3339=seconds`" \
--build-arg VERSION="$CLIENT_IMAGE_VERSION" \
--squash \
--no-cache \
-f ${DOCKER_FILE_LOCATION}/${docker_file} \
-t ${DOCKER_CLIENT_TAG} \
${DOCKER_FILE_LOCATION}
docker buildx create --use --name multiarch-builder
docker buildx inspect --bootstrap

docker buildx build --build-arg BUILD_DATE="`date --rfc-3339=seconds`" \
--build-arg VERSION="$CLIENT_IMAGE_VERSION" \
--platform linux/${ARCH} \
--squash \
--no-cache \
--load \
-f ${DOCKER_FILE_LOCATION}/${docker_file} \
-t ${DOCKER_CLIENT_TAG}-${ARCH} \
${DOCKER_FILE_LOCATION}

if [ -n "${PUSH_DOCKER}" ]; then
mkdir -p $(dirname ${docker_client_tag_file})
echo ${DOCKER_CLIENT_TAG} > ${docker_client_tag_file}
docker push ${DOCKER_CLIENT_TAG}
docker push ${DOCKER_CLIENT_TAG}-${ARCH}
docker manifest create ${DOCKER_CLIENT_TAG} --amend ${DOCKER_CLIENT_TAG}-amd64 --amend ${DOCKER_CLIENT_TAG}-arm64
docker manifest annotate --arch amd64 ${DOCKER_CLIENT_TAG} ${DOCKER_CLIENT_TAG}-amd64
docker manifest annotate --arch arm64 ${DOCKER_CLIENT_TAG} ${DOCKER_CLIENT_TAG}-arm64
docker manifest push ${DOCKER_CLIENT_TAG}
fi

if [ -n "${SAVE_DOCKER}" ]; then
mkdir -p $(dirname ${docker_client_tarball})
docker save ${DOCKER_CLIENT_TAG} | xz > ${docker_client_tarball}
Expand Down
Loading