Search code examples
mavendockerfabric8

Fabric8 Maven Plugin to build docker image


I'm trying to configure Fabric8 Maven plugin to build a docker image for my Spring Boot application.

The following dockerHost configuration works in Ubuntu.

<dockerHost>unix:///var/run/docker.sock</dockerHost>

However, I'm trying to make it work in Windows 10 but couldn't do so. What is the equivalent in Windows 10?


Solution

  • If you have installed Docker using the Docker toolbox, then you can find the Docker host by running:

    docker-machine env default
    

    Where default is the name of the docker machine, which can be found by running docker-machine ls.

    It is also possible to not specify the dockerHost in the pom file, and use the DOCKER_HOST env variable. This variable can be exported using

    eval "$(docker-machine env default)"