[英]how to use docker buildx pushing image to registry use http protocol?
I want to build a multi-arch image and push it to my private registry.我想构建一个多架构映像并将其推送到我的私有注册表。 However, I got an error
但是,我得到了一个错误
"failed to solve: rpc error: code = Unknown desc = failed to do request: Head https://10.7.121.15/v2/daocloud/multiarch-example/blobs/sha256:4c1976b440416ed5a170b2faf49c05af8f298f7afb07ff1f775b7b1ee7574042 : x509: cannot validate certificate for 10.7.121.15 because it doesn't contain any IP SANs"
"failed to solve: rpc error: code = Unknown desc = failed to do request: Head https://10.7.121.15/v2/daocloud/multiarch-example/blobs/sha256:4c1976b440416ed5a170b2faf49c05af8f298f7afb07ff1f775b7b1ee7574042 : x509: cannot validate certificate for 10.7.121.15因为它不包含任何 IP SAN"
when I run command当我运行命令时
"docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag 10.7.121.15/daocloud/multiarch-example:latest -f multi-arch.dockerfile. --push"
"docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag 10.7.121.15/daocloud/multiarch-example:latest -f multi-arch.dockerfile. --push"
so how to solve it or how to use http protocol pushing image?那么如何解决它或如何使用http协议推送图像?
Try passing a config file with http: true
.尝试使用
http: true
传递配置文件。 See this comment for more details.有关更多详细信息,请参阅此评论。 Eg
例如
[registry."10.7.121.15"]
http = true
insecure = true
Try creating a builder like this:尝试创建这样的构建器:
docker buildx create --name ci-builder --driver-opt network=host --use --buildkitd-flags '--allow-insecure-entitlement security.insecure'
The @BMitch answer have solved the issue, but I want to add more details on how to achieve this. @BMitch 的答案已经解决了这个问题,但我想添加更多关于如何实现这一点的细节。
You need to build builder image with the mentioned config.您需要使用上述配置构建构建器映像。 So after creating the config (eg
buildkitd.toml
):所以在创建配置之后(例如
buildkitd.toml
):
[registry."10.7.121.15"]
http = true
insecure = true
you should run the following commands:您应该运行以下命令:
docker buildx rm mybuilder
docker buildx create --name mybuilder --config ./buildkitd.toml --use
docker buildx inspect --bootstrap
docker buildx build ...
You can omit the first line if you don't need to clean up previously created builder.如果您不需要清理以前创建的构建器,则可以省略第一行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.