简体   繁体   中英

using docker buildx failed to push image to resgistry: no such host

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?

可以通过设置--driver-opt使用主机网络来实现。

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