We uses docker buildx
for building our docker packages. To build new image:
- Check is
buildex
driver 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
)
buildx
command passed to Dockerfile additional argumentTARGETPLATFORM
which we used for deciding which arch we want to buildlinux/arm64
orlinux/amd64
- For
dev
builds we callapt install
so switching between architectures happens automatically - For
release
builds we passed intobuild
variables likeDAEMON_URL
,MCL_URL
andEXTRA_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 supported
run manually step one from getting started manual - If you encounter
/bin/sh: Invalid ELF image for this architecture error.
Runmultiarch/qemu-user-static
docker image and then build again