树莓派安装Oracle JDK和Maven
折腾了下,在树莓派上安上了Maven和JDK。然后用Maven编译了一个用了dockerfile-maven-plugin插件的项目,有点坑。
References:
- https://www.raspberrypi.org/forums/viewtopic.php?t=101543
- http://hsuyh.github.io/posts/2016/08/04/Install-Maven-on-RaspberryPi/
- http://maven.apache.org/download.cgi Maven下载地址
- https://github.com/spotify/docker-client/issues/477 dockerfile-maven-plugin编译错误解决方法
首先是安装Oracle JDK,因为在玩Docker的时候感觉OpenJDK有点慢,这里就不去测了,直接安装Oracle JDK。
apt源是已经有了的,当前最新版本为1.8.0_65,如果需要11系统要更新为Buster,不然就只能等等或者自己编译了。
这里就直接安装JDK8了。
一行命令搞定apt install oracle-java8-jdk
过程如下:
[root@raspberrypi32 ~]# apt install oracle-java8-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libxi6 libxrender1 libxtst6 x11-common
The following NEW packages will be installed:
libxi6 libxrender1 libxtst6 oracle-java8-jdk x11-common
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 62.6 MB of archives.
After this operation, 173 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian stretch/main armhf libxi6 armhf 2:1.7.9-1 [77.8 kB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian stretch/main armhf libxrender1 armhf 1:0.9.10-1 [29.9 kB]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian stretch/main armhf x11-common all 1:7.7+19 [251 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian stretch/main armhf libxtst6 armhf 2:1.2.3-1 [26.3 kB]
Get:5 http://mirrors.tuna.tsinghua.edu.cn/raspberrypi stretch/main armhf oracle-java8-jdk armhf 8u65 [62.2 MB]
Fetched 62.6 MB in 11s (5,457 kB/s)
Selecting previously unselected package libxi6:armhf.
(Reading database ... 38322 files and directories currently installed.)
Preparing to unpack .../libxi6_2%3a1.7.9-1_armhf.deb ...
Unpacking libxi6:armhf (2:1.7.9-1) ...
Selecting previously unselected package libxrender1:armhf.
Preparing to unpack .../libxrender1_1%3a0.9.10-1_armhf.deb ...
Unpacking libxrender1:armhf (1:0.9.10-1) ...
Selecting previously unselected package x11-common.
Preparing to unpack .../x11-common_1%3a7.7+19_all.deb ...
Unpacking x11-common (1:7.7+19) ...
Selecting previously unselected package libxtst6:armhf.
Preparing to unpack .../libxtst6_2%3a1.2.3-1_armhf.deb ...
Unpacking libxtst6:armhf (2:1.2.3-1) ...
Selecting previously unselected package oracle-java8-jdk.
Preparing to unpack .../oracle-java8-jdk_8u65_armhf.deb ...
Unpacking oracle-java8-jdk (8u65) ...
Setting up libxi6:armhf (2:1.7.9-1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for systemd (232-25+deb9u11) ...
Setting up libxrender1:armhf (1:0.9.10-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up x11-common (1:7.7+19) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Setting up libxtst6:armhf (2:1.2.3-1) ...
Setting up oracle-java8-jdk (8u65) ...
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/extcheck to provide /usr/bin/extcheck (extcheck) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/idlj to provide /usr/bin/idlj (idlj) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javah to provide /usr/bin/javah (javah) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jhat to provide /usr/bin/jhat (jhat) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jsadebugd to provide /usr/bin/jsadebugd (jsadebugd) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/native2ascii to provide /usr/bin/native2ascii (native2ascii) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/schemagen to provide /usr/bin/schemagen (schemagen) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode
update-alternatives: using /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for systemd (232-25+deb9u11) ...
[root@raspberrypi32 ~]# java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)
[root@raspberrypi32 ~]# javac -version
javac 1.8.0_65
[root@raspberrypi32 ~]#
下面就是Maven了,由于没有官方的源,所以需要自己去下载,下载地址见上参考链接。
这里我把maven放到/usr/local
下,你可以放到你觉得合适的地方。
参考过程如下:
[root@raspberrypi32 ~]# tar -zxvf apache-maven-3.6.1-bin.tar.gz
[ ... ]
[root@raspberrypi32 ~]# ls
apache-maven-3.6.1 apache-maven-3.6.1-bin.tar.gz ...
[root@raspberrypi32 ~]# cd /usr/local/
[root@raspberrypi32 local]# mkdir maven
[root@raspberrypi32 local]# cd maven/
[root@raspberrypi32 maven]# mv /root/apache-maven-3.6.1 ./
[root@raspberrypi32 maven]# ls
apache-maven-3.6.1
[root@raspberrypi32 maven]#
然后告诉系统去哪里读取Maven
[root@raspberrypi32 maven]# vim /etc/profile.d/maven.sh
写入如下内容,注意maven路径替换成你自己的
export M2_HOME=/usr/local/maven/apache-maven-3.6.1
export PATH=$PATH:$M2_HOME/bin
然后退出重登,查看版本:
[root@raspberrypi32 ~]# mvn -version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
Maven home: /usr/local/maven/apache-maven-3.6.1
Java version: 1.8.0_65, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "4.19.66-v7+", arch: "arm", family: "unix"
[root@raspberrypi32 ~]#
安装成功。
一般使用应该是没问题的,但是当用了dockerfile-maven-plugin这个插件后就不一样了,用Maven去编译项目的时候……
[root@raspberrypi32 microservice-eureka-server]# mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.racecoder:microservice-eureka-server >--------------
[INFO] Building microservice-eureka-server 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ microservice-eureka-server ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ microservice-eureka-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ microservice-eureka-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /opt/bilibili/microservice-eureka-server/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ microservice-eureka-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /opt/bilibili/microservice-eureka-server/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ microservice-eureka-server ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ microservice-eureka-server ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ microservice-eureka-server ---
[INFO] Building jar: /opt/bilibili/microservice-eureka-server/target/microservice-eureka-server.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.4.RELEASE:repackage (repackage) @ microservice-eureka-server ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- dockerfile-maven-plugin:1.4.12:build (default) @ microservice-eureka-server ---
[INFO] dockerfile: null
[INFO] contextDirectory: /opt/bilibili/microservice-eureka-server
[INFO] Building Docker context /opt/bilibili/microservice-eureka-server
[INFO] Path(dockerfile): null
[INFO] Path(contextDirectory): /opt/bilibili/microservice-eureka-server
[INFO]
[INFO] Image will be built as racecoder/microservice-eureka-server:0.0.1-SNAPSHOT
[INFO]
[WARNING] An attempt failed, will retry 1 more times
org.apache.maven.plugin.MojoExecutionException: Could not build image
at com.spotify.plugin.dockerfile.BuildMojo.buildImage (BuildMojo.java:247)
at com.spotify.plugin.dockerfile.BuildMojo.execute (BuildMojo.java:135)
[ ... ]
Caused by: com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.lang.UnsatisfiedLinkError: could not load FFI provider com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider
at com.spotify.docker.client.DefaultDockerClient.propagate (DefaultDockerClient.java:2848)
at com.spotify.docker.client.DefaultDockerClient.request (DefaultDockerClient.java:2712)
at com.spotify.docker.client.DefaultDockerClient.version (DefaultDockerClient.java:600)
at com.spotify.docker.client.DefaultDockerClient.authRegistryHeader (DefaultDockerClient.java:2891)
[ ... ]
Caused by: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.lang.UnsatisfiedLinkError: could not load FFI provider com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider
at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture$Sync.getValue (AbstractFuture.java:299)
at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture$Sync.get (AbstractFuture.java:286)
at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture.get (AbstractFuture.java:116)
at com.spotify.docker.client.DefaultDockerClient.request (DefaultDockerClient.java:2710)
at com.spotify.docker.client.DefaultDockerClient.version (DefaultDockerClient.java:600)
at com.spotify.docker.client.DefaultDockerClient.authRegistryHeader (DefaultDockerClient.java:2891)
at com.spotify.docker.client.DefaultDockerClient.build (DefaultDockerClient.java:1498)
[ ... ]
Caused by: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.lang.UnsatisfiedLinkError: could not load FFI provider com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime.processFailure (ClientRuntime.java:202)
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime.access$400 (ClientRuntime.java:79)
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$2.run (ClientRuntime.java:182)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call (Errors.java:271)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call (Errors.java:267)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process (Errors.java:267)
at com.spotify.docker.client.shaded.org.glassfish.jersey.process.internal.RequestScope.runInScope (RequestScope.java:340)
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$3.run (ClientRuntime.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
at java.lang.Thread.run (Thread.java:745)
Caused by: java.lang.UnsatisfiedLinkError: could not load FFI provider com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider
at com.spotify.docker.client.shaded.jnr.ffi.provider.InvalidProvider$1.loadLibrary (InvalidProvider.java:48)
at com.spotify.docker.client.shaded.jnr.ffi.LibraryLoader.load (LibraryLoader.java:325)
at com.spotify.docker.client.shaded.jnr.unixsocket.Native.<clinit> (Native.java:80)
at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.<init> (UnixSocketChannel.java:101)
at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.open (UnixSocketChannel.java:60)
at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket (UnixConnectionSocketFactory.java:69)
[ ... ]
Caused by: java.lang.ExceptionInInitializerError
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.getInstance (NativeRuntime.java:58)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider.<init> (Provider.java:29)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance (Constructor.java:422)
at java.lang.Class.newInstance (Class.java:442)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance (FFIProvider.java:68)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit> (FFIProvider.java:57)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider.getSystemProvider (FFIProvider.java:35)
at com.spotify.docker.client.shaded.jnr.ffi.LibraryLoader.create (LibraryLoader.java:73)
[ ... ]
Caused by: java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/jffi225870989337159849.so: /tmp/jffi225870989337159849.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:371)
at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258)
at com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:444)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.kenai.jffi.Init.load(Init.java:68)
at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)
at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:45)
at com.kenai.jffi.Foreign.getInstance(Foreign.java:103)
at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)
at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
at com.kenai.jffi.Type.resolveSize(Type.java:155)
at com.kenai.jffi.Type.size(Type.java:138)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:187)
at com.spotify.docker.client.shaded.jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:66)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:41)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:62)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:58)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
at com.spotify.docker.client.shaded.jnr.ffi.LibraryLoader.create(LibraryLoader.java:73)
at com.spotify.docker.client.shaded.jnr.unixsocket.Native.<clinit>(Native.java:76)
at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.<init>(UnixSocketChannel.java:101)
at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.open(UnixSocketChannel.java:60)
at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:69)
at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:44)
at com.spotify.docker.client.shaded.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:118)
at com.spotify.docker.client.shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at com.spotify.docker.client.shaded.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at com.spotify.docker.client.shaded.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:435)
at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector$1.run(ApacheConnector.java:491)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at jersey.repackaged.com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:50)
at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:37)
at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:487)
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:178)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at com.spotify.docker.client.shaded.org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at com.kenai.jffi.internal.StubLoader.load (StubLoader.java:270)
at com.kenai.jffi.internal.StubLoader.<clinit> (StubLoader.java:444)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java:348)
at com.kenai.jffi.Init.load (Init.java:68)
at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder (Foreign.java:49)
at com.kenai.jffi.Foreign$InstanceHolder.<clinit> (Foreign.java:45)
at com.kenai.jffi.Foreign.getInstance (Foreign.java:103)
at com.kenai.jffi.Type$Builtin.lookupTypeInfo (Type.java:242)
at com.kenai.jffi.Type$Builtin.getTypeInfo (Type.java:237)
at com.kenai.jffi.Type.resolveSize (Type.java:155)
at com.kenai.jffi.Type.size (Type.java:138)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size (NativeRuntime.java:187)
at com.spotify.docker.client.shaded.jnr.ffi.provider.AbstractRuntime.<init> (AbstractRuntime.java:48)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init> (NativeRuntime.java:66)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init> (NativeRuntime.java:41)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit> (NativeRuntime.java:62)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.getInstance (NativeRuntime.java:58)
at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider.<init> (Provider.java:29)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance (Constructor.java:422)
at java.lang.Class.newInstance (Class.java:442)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance (FFIProvider.java:68)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit> (FFIProvider.java:57)
at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider.getSystemProvider (FFIProvider.java:35)
at com.spotify.docker.client.shaded.jnr.ffi.LibraryLoader.create (LibraryLoader.java:73)
at com.spotify.docker.client.shaded.jnr.unixsocket.Native.<clinit> (Native.java:76)
at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.<init> (UnixSocketChannel.java:101)
at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.open (UnixSocketChannel.java:60)
at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket (UnixConnectionSocketFactory.java:69)
at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket (UnixConnectionSocketFactory.java:44)
at com.spotify.docker.client.shaded.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect (DefaultHttpClientConnectionOperator.java:118)
at com.spotify.docker.client.shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect (PoolingHttpClientConnectionManager.java:353)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.establishRoute (MainClientExec.java:380)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:236)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:184)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:88)
at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110)
at com.spotify.docker.client.shaded.org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:184)
at com.spotify.docker.client.shaded.org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:71)
at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply (ApacheConnector.java:435)
at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector$1.run (ApacheConnector.java:491)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at jersey.repackaged.com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute (MoreExecutors.java:299)
at java.util.concurrent.AbstractExecutorService.submit (AbstractExecutorService.java:112)
at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit (AbstractListeningExecutorService.java:50)
at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit (AbstractListeningExecutorService.java:37)
at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply (ApacheConnector.java:487)
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$2.run (ClientRuntime.java:178)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call (Errors.java:271)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call (Errors.java:267)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process (Errors.java:267)
at com.spotify.docker.client.shaded.org.glassfish.jersey.process.internal.RequestScope.runInScope (RequestScope.java:340)
at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$3.run (ClientRuntime.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
at java.lang.Thread.run (Thread.java:745)
[INFO] dockerfile: null
[INFO] contextDirectory: /opt/bilibili/microservice-eureka-server
[INFO] Building Docker context /opt/bilibili/microservice-eureka-server
[INFO] Path(dockerfile): null
[INFO] Path(contextDirectory): /opt/bilibili/microservice-eureka-server
[INFO]
[INFO] Image will be built as racecoder/microservice-eureka-server:0.0.1-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:27 min
[INFO] Finished at: 2019-09-06T20:30:33+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.12:build (default) on project microservice-eureka-server: Could not build image: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.lang.UnsatisfiedLinkError: could not load FFI provider com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider: ExceptionInInitializerError: Can't overwrite cause with java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/jffi225870989337159849.so: /tmp/jffi225870989337159849.so: cannot open shared object file: No such file or directory
[ERROR] at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[ERROR] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
[ERROR] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
[ERROR] at java.lang.Runtime.load0(Runtime.java:809)
[ERROR] at java.lang.System.load(System.java:1086)
[ERROR] at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:371)
[ERROR] at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258)
[ERROR] at com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:444)
[ERROR] at java.lang.Class.forName0(Native Method)
[ERROR] at java.lang.Class.forName(Class.java:348)
[ERROR] at com.kenai.jffi.Init.load(Init.java:68)
[ERROR] at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)
[ERROR] at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:45)
[ERROR] at com.kenai.jffi.Foreign.getInstance(Foreign.java:103)
[ERROR] at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)
[ERROR] at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
[ERROR] at com.kenai.jffi.Type.resolveSize(Type.java:155)
[ERROR] at com.kenai.jffi.Type.size(Type.java:138)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:187)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:66)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:41)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:62)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:58)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
[ERROR] at java.lang.Class.newInstance(Class.java:442)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
[ERROR] at com.spotify.docker.client.shaded.jnr.ffi.LibraryLoader.create(LibraryLoader.java:73)
[ERROR] at com.spotify.docker.client.shaded.jnr.unixsocket.Native.<clinit>(Native.java:76)
[ERROR] at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.<init>(UnixSocketChannel.java:101)
[ERROR] at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.open(UnixSocketChannel.java:60)
[ERROR] at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:69)
[ERROR] at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:44)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:118)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
[ERROR] at com.spotify.docker.client.shaded.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:435)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector$1.run(ApacheConnector.java:491)
[ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[ERROR] at jersey.repackaged.com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299)
[ERROR] at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
[ERROR] at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:50)
[ERROR] at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:37)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:487)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:178)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:315)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:297)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:267)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
[ERROR] at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:210)
[ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[ERROR] at java.lang.Thread.run(Thread.java:745)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[root@raspberrypi32 microservice-eureka-server]#
经过我的一番查找,发现gayhub上有人和我有一样的错误,看了下,是arm平台没有JFFI这个库,于是我们自己编译一下:
sudo apt-get install build-essential
git clone https://github.com/jnr/jffi.git
cd jffi
# 需要安装ant
ant jar
编译好了之后,拷贝下库文件:
cd build/jni
sudo cp libjffi-1.2.so /usr/lib
这里提供下我编译好的库,方便部分有需要的人。在树莓派3B(armv7l),系统stretch下使用正常。下载 libjffi-1.2.so.zip。
SHA256: D165A6CC4F4F533DFA63307BBDCF9EC3E2F7F8BAF3985A1D0768A348DA2007D3
再次编译,结果如下:
[root@raspberrypi32 microservice-eureka-server]# ls
Dockerfile pom.xml src target
[root@raspberrypi32 microservice-eureka-server]# mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.racecoder:microservice-eureka-server >--------------
[INFO] Building microservice-eureka-server 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ microservice-eureka-server ---
[INFO] Deleting /opt/bilibili/microservice-eureka-server/target
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ microservice-eureka-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ microservice-eureka-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /opt/bilibili/microservice-eureka-server/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ microservice-eureka-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /opt/bilibili/microservice-eureka-server/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ microservice-eureka-server ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ microservice-eureka-server ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ microservice-eureka-server ---
[INFO] Building jar: /opt/bilibili/microservice-eureka-server/target/microservice-eureka-server.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.4.RELEASE:repackage (repackage) @ microservice-eureka-server ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- dockerfile-maven-plugin:1.4.12:build (default) @ microservice-eureka-server ---
[INFO] dockerfile: null
[INFO] contextDirectory: /opt/bilibili/microservice-eureka-server
[INFO] Building Docker context /opt/bilibili/microservice-eureka-server
[INFO] Path(dockerfile): null
[INFO] Path(contextDirectory): /opt/bilibili/microservice-eureka-server
[INFO]
[INFO] Image will be built as racecoder/microservice-eureka-server:0.0.1-SNAPSHOT
[INFO]
[INFO] Step 1/7 : FROM dpsmyth/raspberrypi3-alpine-java
[INFO]
[INFO] Pulling from dpsmyth/raspberrypi3-alpine-java
[INFO] Digest: sha256:d951c4541306b4c3c8310922f3497172e5d13cb0bbf598119a4c5a6e56ae5695
[INFO] Status: Image is up to date for dpsmyth/raspberrypi3-alpine-java:latest
[INFO] ---> 5b6b20fca4b6
[INFO] Step 2/7 : VOLUME ["/tmp"]
[INFO]
[INFO] ---> Running in 2c4d1c3a1ef7
[INFO] Removing intermediate container 2c4d1c3a1ef7
[INFO] ---> 43d549847a46
[INFO] Step 3/7 : RUN echo "#aliyun" > /etc/apk/repositories && echo "https://mirrors.aliyun.com/alpine/v3.6/main/" >> /etc/apk/repositories && echo "https://mirrors.aliyun.com/alpine/v3.6/community/" >> /etc/apk/repositories && apk update && apk add tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
[INFO]
[INFO] ---> Running in 1e080581c2a9
[INFO] fetch https://mirrors.aliyun.com/alpine/v3.6/main/armhf/APKINDEX.tar.gz
[INFO] fetch https://mirrors.aliyun.com/alpine/v3.6/community/armhf/APKINDEX.tar.gz
[INFO] v3.6.5-44-gda55e27396 [https://mirrors.aliyun.com/alpine/v3.6/main/]
[INFO] v3.6.5-34-gf0ba0b43d5 [https://mirrors.aliyun.com/alpine/v3.6/community/]
[INFO] OK: 8342 distinct packages available
[INFO] (1/1) Installing tzdata (2019a-r0)
[INFO] Executing busybox-1.28.4-r3.trigger
[INFO] OK: 44 MiB in 67 packages
[INFO] Removing intermediate container 1e080581c2a9
[INFO] ---> ea8a323496d1
[INFO] Step 4/7 : COPY target/*.jar app.jar
[INFO]
[INFO] ---> d12860c7ec23
[INFO] Step 5/7 : RUN bash -c 'touch /app.jar'
[INFO]
[INFO] ---> Running in f8f181d00831
[INFO] Removing intermediate container f8f181d00831
[INFO] ---> 54a9ecd2b1c8
[INFO] Step 6/7 : EXPOSE 8761
[INFO]
[INFO] ---> Running in 49570f706254
[INFO] Removing intermediate container 49570f706254
[INFO] ---> 0b34959deb61
[INFO] Step 7/7 : ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.jar"]
[INFO]
[INFO] ---> Running in dac12bceadec
[INFO] Removing intermediate container dac12bceadec
[INFO] ---> 91d3dbe22c19
[INFO] [Warning] One or more build-args [JAR_FILE] were not consumed
[INFO] Successfully built 91d3dbe22c19
[INFO] Successfully tagged racecoder/microservice-eureka-server:0.0.1-SNAPSHOT
[INFO]
[INFO] Detected build of image with id 91d3dbe22c19
[INFO] Building jar: /opt/bilibili/microservice-eureka-server/target/microservice-eureka-server-docker-info.jar
[INFO] Successfully built racecoder/microservice-eureka-server:0.0.1-SNAPSHOT
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ microservice-eureka-server ---
[INFO] Installing /opt/bilibili/microservice-eureka-server/target/microservice-eureka-server.jar to /root/.m2/repository/com/racecoder/microservice-eureka-server/0.0.1-SNAPSHOT/microservice-eureka-server-0.0.1-SNAPSHOT.jar
[INFO] Installing /opt/bilibili/microservice-eureka-server/pom.xml to /root/.m2/repository/com/racecoder/microservice-eureka-server/0.0.1-SNAPSHOT/microservice-eureka-server-0.0.1-SNAPSHOT.pom
[INFO] Installing /opt/bilibili/microservice-eureka-server/target/microservice-eureka-server-docker-info.jar to /root/.m2/repository/com/racecoder/microservice-eureka-server/0.0.1-SNAPSHOT/microservice-eureka-server-0.0.1-SNAPSHOT-docker-info.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:26 min
[INFO] Finished at: 2019-09-06T20:42:57+08:00
[INFO] ------------------------------------------------------------------------
[root@raspberrypi32 microservice-eureka-server]#
显示结果成功,查看下docker镜像:
[root@raspberrypi32 microservice-eureka-server]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
racecoder/microservice-eureka-server 0.0.1-SNAPSHOT 91d3dbe22c19 58 seconds ago 252MB
127.0.0.1:5000/racecoder/microservice-eureka-server 0.0.1-SNAPSHOT c128f40d5578 27 hours ago 252MB
arm32v7/nginx <none> e09f192863c9 2 weeks ago 97.6MB
registry <none> c99846f41d25 6 months ago 22.1MB
dpsmyth/raspberrypi3-alpine-java latest 5b6b20fca4b6 6 months ago 159MB
[root@raspberrypi32 microservice-eureka-server]#
完美,下面就是三台机器集群了。