简体   繁体   English

如何使用 docker buildx 推送镜像到注册表使用 http 协议?

[英]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.

相关问题 Docker 使用带有 buildx 的本地镜像 - Docker use local image with buildx 如何使用 docker buildx bake 替换 docker-compose up? - How to use docker buildx bake to replace docker-compose up? 将 buildx 镜像推送到 quay registry - Pushing buildx images to quay registry docker buildx - 如何使用不同的 Dockerfile 或合二为一 - docker buildx - how to use different Dockerfile or switch in one 将 Docker 镜像推送到 Container Registry - Pushing the Docker image to Container Registry 码头工人:如何防止使用来自码头工人注册表的最新映像? - Docker: How to prevent the use of latest image from docker registry? 我如何将 docker buildx 构建到本地“注册表”容器中 - How do I docker buildx build into a local "registry" container 如何使用 Docker Registry HTTP API V2 获取 docker registry 中所有仓库的列表? - How can I use Docker Registry HTTP API V2 to obtain a list of all repositories in a docker registry? 如何使用 Azure Pipeline 将 docker 映像“推送”到 Azure 容器注册表? - How to use Azure Pipeline to "Push" a docker image to Azure Container Registry? 将 docker buildx 功能与 Jenkins docker.build 一起使用 - Use docker buildx feature with Jenkins docker.build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM