Fabric8:docker-maven-plugin 在 Jenkins 中的 Centos7 上运行时无法加载 ffi 提供程序

Dav*_*kow 1 maven-3 fabric8 centos7 docker-maven-plugin

将fabric8添加到hello world pom后,在CentOS7上的Jenkins中运行maven“clean install”时,

            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.31.0</version>
                <configuration>
                    <filter>${*}</filter>
                    <images>
                        <image>
                            <name>docker.io/myname/${project.artifactId}:${project.version}</name>
                        </image>
                    </images>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin> 
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.31.0:build (default) on project reference-service: Execution default of goal io.fabric8:docker-maven-plugin:0.31.0:build failed: An API incompatibility was encountered while executing io.fabric8:docker-maven-plugin:0.31.0:build: java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>io.fabric8:docker-maven-plugin:0.31.0
Run Code Online (Sandbox Code Playgroud)

...

[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: could not get native definition for type: POINTER: java.lang.UnsatisfiedLinkError: /tmp/jffi5159674609596634370.so: /tmp/jffi5159674609596634370.so: failed to map segment from shared object: Operation not permitted
Run Code Online (Sandbox Code Playgroud)

我找不到 CentOS7 的 .so 文件的任何安装说明或其他说明。

GitHub 站点没有提供太多指导;

Docker 正在监听 2375 和 docker.sock。我正在 dockerroot 中构建的用户。

保险丝也有同样的问题

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.23.0.fuse-730010-redhat-00001:build (default) on project reference-service: Execution default of goal io.fabric8:docker-maven-plugin:0.23.0.fuse-730010-redhat-00001:build failed: An API incompatibility was encountered while executing io.fabric8:docker-maven-plugin:0.23.0.fuse-730010-redhat-00001:build: java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
[ERROR] realm =    plugin>io.fabric8:docker-maven-plugin:0.23.0.fuse-730010-redhat-00001
Run Code Online (Sandbox Code Playgroud)

Jor*_*var 5

有两种选择:

  • 简单一:升级到插件的最新版本。该问题已在版本 0.38.1 中得到解决

https://github.com/fabric8io/docker-maven-plugin/releases/tag/v0.38.1

  • 更复杂的一个(如果你可以升级你的插件版本):按照这个教程m1 芯片 + f8-插件问题。是 socat 和 DOCKER_HOST 的组合