maven软件包docker:build-连接被拒绝 [英] maven package docker:build - connection refused

查看:513
本文介绍了maven软件包docker:build-连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用mvn package docker:build用maven直接构建docker映像.

I am trying to directly build a docker image with maven with mvn package docker:build.

Docker正在运行,并且docker ps向我展示了我的容器,因此我假设一切都正常运行.我确实收到以下错误:

Docker is running and docker ps shows me my containers, so I assume that everything is running correctly. I do get the following error though:

[错误]无法在项目库上执行目标com.spotify:docker-maven-plugin:0.2.3:build(default-cli):捕获到异常:java.util.concurrent.ExecutionException:com.spotify.docker .client.shaded.javax.ws.rs.ProcessingException:o rg.apache.http.conn.HttpHostConnectException:连接到localhost:2375 [localhost/127.0.0.1,localhost/0:0:0:0:0:0:0:0:1]失败:连接被拒绝:connect->

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (default-cli) on project reservierung: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: o rg.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect ->

我的第一种方法是,由于我在Windows上工作,因此我需要调用docker-machine ip地址而不是localhost,但这也没有用.我在这里有点不知所措,因为我以为我做错了很简单,但是当docker(貌似)正常运行时,我找不到任何有关拒绝连接错误的信息.

My first approach was that since I am working on windows I need to call the docker-machine ip address instead of localhost, but that also didn't work. I am kind of at a loss here, because I assume that it's something simple that I am doing wrong, but I cannot find anything about the connection refused error when docker is (seemingly) running properly.

很抱歉,这很简单.

推荐答案

在使用Docker/Hyper-V的Windows上,这是通过com.spotify:docker-maven-plugin:1.0.0发生的.关于此

On Windows with Docker/Hyper-V this occurred to me with com.spotify:docker-maven-plugin:1.0.0. There is a discussion about this

.它对我有用.

这篇关于maven软件包docker:build-连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆