我有一个由其他人编写的父 pom,它用于在本地构建和运行 docker 映像。当我尝试使用父 pom.xml 进行构建时,出现以下错误,'~/.m2' cannot be relativized, cannot resolve arbitrary user home paths.
我认为错误在于将卷绑定到图像。这就是它在父 pom.xml 中的定义方式
<volumes>
<bind>
<volume>${session.executionRootDirectory}:${session.executionRootDirectory}</volume>
<!-- Mounts the Maven repository so that the Docker container doesn't have to re-download dependencies. -->
<volume>~/.m2:/root/.m2</volume>
</bind>
</volumes>
上面的项目在 mac os 上运行良好,我使用的是 windows 机器。我安装docker for windows
并阅读了fabric8 文档,了解如何将卷绑定到您的图像,但找不到与我的问题相关的任何示例。