0

我正在使用 fabric8 docker-maven 插件从 docker 文件构建 docker 映像。我正在使用 RHEL8。

这是我的 pom 插件。

<plugin>
    <groupId>io.fabric8</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>0.36.1</version>
    <executions>
        <execution>
            <id>build tag</id>
            <phase>install</phase>
            <goals>
                <goal>build</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <images>
            <image>
                <name>cat/image:1.0.0</name>
                <alias>springboot-mongo-dockerimage</alias>
                <build>
                    <dockerFileDir>${project.basedir}</dockerFileDir>
                    <args><BASE_IMAGE>repo/image:1.0.0</BASE_IMAGE></args>
                </build>
            </image>
        </images>
    </configuration>

从我的 Dockerfile 中,隐藏文件夹正在从以下命令复制到 docker 映像。

COPY myHome/.folder1/my.properties ${DOC_IMAGE}/.folder1

执行上述代码时,出现以下错误。

 Failed to execute goal io.fabric8:docker-maven-plugin:0.36.1:build
 (build tag) on project myproject-1: Unable to build image
 [cat/image:1.0.0] : "COPY failed: stat
 /var/snap/docker/common/var-lib-docker/tmp/docker-builder864356699/myHome/.folder1/my.properties: no such file or directory" .

而且,在我的项目中,我也没有 .dockerignore 文件。

我需要特殊的东西来将隐藏文件包含到 docker 图像中吗?

4

0 回答 0