docker编译多arch镜像
安装 docker-ce 内核需求>=4.8
在~/.docker/config.json加入
"experimental" : "enabled"在/etc/docker/daemon.json加入
"features": { "buildkit": true }安装软件包
apt-get install -y qemu-user-static binfmt-support 检查binfmt挂载
cat /proc/sys/fs/binfmt_misc/status创建并切换buildx实例
docker buildx create --name builder \
--driver docker-container --driver-opt network=host \
--driver-opt env.https_proxy=http://1.2.3.4:8228 \
--driver-opt env.no_proxy=example.com \
--buildkitd-flags '--containerd-worker-net=host --oci-worker-net=host'
docker buildx use builder初始化buildx镜像
docker buildx inspect --bootstrap
docker buildx ls编译镜像并上传
清理缓存
Last updated
Was this helpful?