简体   繁体   中英

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"

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"

so how to solve it or how to use http protocol pushing image?

Try passing a config file with 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.

You need to build builder image with the mentioned config. So after creating the config (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM