I'm trying to setup docker-maven-plugin
by fabric8
so I can use it from Bitbucket Pipelines.
My pom.xml looks like this:
..
..
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<dockerHost>???????????</dockerHost>
<verbose>true</verbose>
<pushRegistry>true</pushRegistry>
<authConfig>
<username>username</username>
<password>password</password>
</authConfig>
<images>
<image>
<registry>registry.hub.docker.com</registry>
<name>${dockerhub.repository}</name>
<build>
<dockerFileDir>${project.basedir}</dockerFileDir>
<tags>
<tag>${docker.tag}</tag>
</tags>
<noCache>true</noCache>
</build>
</image>
</images>
</configuration>
<executions>
...
</plugin>
This works perfectly when running locally. The error I'm getting on Bitbucket Pipelines is:
[ERROR] DOCKER> 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 (Connection refused)]
Yeah, this is happens since I'm not sure what to put in <dockerHost>
tag, any idea?
Is there anything else needs to be done to make this work remotely?
Thank you!
I was facing the same issue but in running Integration tests which depend on docker images. After a lot of searches I found the following
There's undocumented environment variable of
$BITBUCKET_DOCKER_HOST_INTERNAL
which maybe helpful in your case.I chose to add needed docker images as services in my bitbucket pipeline instead of depend on fabric8 as the following
as mentioned in there documentation here
I hope this would be helpful