Docker :Could not push image

263 阅读1分钟

docker 往生产环境push image失败,报错如下:

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 01:03 min

[INFO] Finished at: 2022-06-29T09:20:03+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.10:push (default-cli) on project wx-service: Could not push image: Get http:

//192.168.0.45:5000/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

网上普遍都说是要修改daemon.json文件,安装他们说的方法,添加镜像仓库,然后重启docker,但是发现还是不行,后来认真看了一下,想着之前就没有问题,那么是不是需要重启192.168.0.45服务器上的docker就可以了,就试了一下,果然是docker重启一下就可以了!

最终的解决方案: 重启docker systemctl restart docker