Docker支持多架构

注:
要求19.03以上版本(以下的不支持,Ubuntu 18.04的docker默认版本为19.03)

创建支持多架构的docker image (加buildx命令)

export DOCKER_CLI_EXPERIMENTAL=enabled (作用是启用buildx)

docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3 (注册ARM架构)

cat /proc/sys/fs/binfmt_misc/qemu-aarch64 (确保enabled)

docker buildx create --driver docker-container --use

docker buildx inspect --bootstrap

docker buildx ls (此时会多出来arm、arm64、ppc64le等)

docker buildx build --platform linux/arm/v7,local --load -t ming:1.0 .