我正在尝试设置docker-maven-plugin
,fabric8
以便可以从 Bitbucket Pipelines 使用它。
我的 pom.xml 看起来像这样:
..
..
<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>
这在本地运行时非常有效。我在 Bitbucket Pipelines 上遇到的错误是:
[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)]
是的,这是因为我不确定要在<dockerHost>
标签中添加什么,知道吗?是否需要做任何其他事情才能远程完成这项工作?
谢谢!