fabric8-maven-plugin: Cannot create docker access object: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

Description

I am beginner to fabric8, trying to build an image for spring-boot app. Getting error : cannot create docker access object: trying from windows 10,

Info

[INFO] — fabric8-maven-plugin:4.3.0:build (default) @ lb-server — [WARNING] F8: Cannot access cluster for detecting mode: connect timed out [INFO] F8: Running in Kubernetes mode [INFO] F8: Building Container image with Docker in Kubernetes mode [WARNING] F8: Cannot access cluster for detecting mode: connect timed out [WARNING] F8: Cannot access cluster for detecting mode: connect timed out [ERROR] F8: Cannot create docker access object [Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 47.450 s [INFO] Finished at: 2019-10-20T01:10:05+05:30 [INFO] Final Memory: 49M/411M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:4.3.0:build (default) on project lb-server: Cannot create docker access object: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect -> [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.

  • f-m-p version : 4.3.0
  • Maven version (mvn -v) :3

  • Kubernetes / OpenShift setup and version :

  • If it’s a bug, how to reproduce : <plugin> <groupId>io.fabric8</groupId> <artifactId>fabric8-maven-plugin</artifactId> <version>4.3.0</version> <configuration> <images> <image> <name>user/demo</name> <build> <dockerFileDir>.</dockerFileDir> <filter>@</filter> </build> </image> </images> <skipPush>true</skipPush> <dockerHost>${docker.host.address}</dockerHost>

                      <!--&lt;!&ndash;</createOptions>&ndash;&gt;-->
                  <!--</machine>-->
              </configuration>
              <executions>
                  <execution>
                      <goals>
                          <!--<goal>resource</goal>-->
                          <goal>help</goal>
                          <goal>build</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
    

<docker.host.address>tcp://localhost:2375</docker.host.address>

mvn clean install

  • If it’s a feature request, what is your use case :
  • Sample project : [GitHub Clone URL]

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 39 (22 by maintainers)

Most upvoted comments

Hi @mohapsub I’m currently using remote docker environment(s) from my Windows 10 Home machine (where docker is not supported natively) In order to be able to use the Docker client with (for example) Minikube’s Docker daemon, you need to setup a couple of environment variables (just like @rohanKanojia mentioned).

Run the following command to check the values applicable for the Docker environment variables: minikube docker-env image

Now open your user system environment variable configuration and add those values:

image image

From now on, whenever you create a new process, you’ll be able to run any docker command successfully (docker ps, docker images, etc.)

FMP will detect these values too.

thanks my problem resolved long back, i was not very active. Thanks for posting this