I have added my registry vm hostname to /etc/hosts and docker pull <registry_name>/<imagename> works.
However when I try to use docker buildx build .. --push command to push to the same registry, it throws error:
=> ERROR exporting to image 2.3s
=> => exporting layers 1.9s
=> => exporting manifest sha256:... 0.1s
=> => exporting config sha256:... 0.0s
=> => exporting manifest sha256: ... 0.0s
=> => exporting config sha256: 0.1s
=> => exporting manifest list sha256: 0.0s
=> => pushing layers 0.1s
------
> exporting to image:
------
failed to solve: rpc error: code = Unknown desc = failed to do request: Head https://<registry_name>/v2/...: dial tcp: lookup <registry_name> : no such host
Does docker buildx does not look /etc/hosts?
It can be achieved by setting --driver-opt to use host network.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With