We uses docker buildx for building our docker packages. To build new image:
- Check is
buildexdriver was already started, and re-run it in case check was failed:
if [[ ! $(docker ps | grep manticore_build) ]]; then
docker buildx create --name manticore_build --platform linux/amd64,linux/arm64
docker buildx use manticore_build
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
fi- Next run build:
docker buildx build \
--build-arg DEV=1 \
--push \
--platform linux/arm64,linux/amd64 \
--tag manticoresearch/manticore:multi-arch-$BUILD_TAG .We have two arch for builds (amd & arm)
buildxcommand passed to Dockerfile additional argumentTARGETPLATFORMwhich we used for deciding which arch we want to buildlinux/arm64orlinux/amd64- For
devbuilds we callapt installso switching between architectures happens automatically - For
releasebuilds we passed intobuildvariables likeDAEMON_URL. Very important that each of that links has_ARCH_placeholder. Like:This placeholder substitutes to arch during build process.https://repo.manticoreseatch.com/tarball_location/manticore_ARCH_.tgz
- If you see
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to load LLB: runtime execution on platform linux/arm64 not supportedrun manually step one from getting started manual - If you encounter
/bin/sh: Invalid ELF image for this architecture error.Runmultiarch/qemu-user-staticdocker image and then build again