docker构建多平台容器
1.创建builder配置文件
buildkitd.toml
debug = true
[registry."docker.io"]
#mirrors = ["hub.dvcloud.xin"]
http = true
insecure = true
2.定义需要构建的平台
platform="linux/amd64,linux/arm64"
3.创建builder
if ! docker buildx ls |grep xadmin-builder &>/dev/null;then
docker buildx create --platform "${platform}" --name xadmin-builder --driver docker-container --buildkitd-config buildkitd.toml --bootstrap --use
fi
4.启用构建,并推送到仓库
在Dockerfile目录下,执行构建命令
docker buildx use xadmin-builder
docker buildx build -t nineaiyu/xadmin-server:4.1.5 --platform "${platform}" --push --provenance=false .
原文地址:https://blog.csdn.net/ly1358152944/article/details/143822811
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!