Closed andyceo closed 6 years ago
Hi! Thanks for your contribution and waiting :)
Yes, it didn't work with your image on dockerhub. I went to the docker container:
docker container run -it --rm --entrypoint "/bin/sh" andyceo/waves:0.9.2
And found that:
/ # java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (IcedTea 3.6.0) (Alpine 8.151.12-r0)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
Looks like, you used openjdk:jre-alpine
. Note, it is recommended to use slim version if the app doesn't use UI-related java libraries.
I tried to reproduce this bug with other JVMs:
Copied your Dockerfile locally
Changed:
FROM openjdk:9-jre-slim
to:
FROM openjdk:8-jre-slim
Also added RUN ["java", "-version"]
to verify JRE and removed update-ca-certificates && \
(I know, it is critical, but a build hangs often on this line, and it is ok for testing).
So, the content of the Dockerfile became:
FROM alpine as crawler
ENV WAVES_VERSION 0.9.2
RUN apk add --no-cache --update ca-certificates curl && \
curl -sLo /waves.jar "https://github.com/wavesplatform/Waves/releases/download/v${WAVES_VERSION}/waves-all-${WAVES_VERSION}.jar" && \
curl -sLo /waves-devnet.conf "https://raw.githubusercontent.com/wavesplatform/Waves/v${WAVES_VERSION}/waves-devnet.conf" && \
curl -sLo /waves-mainnet.conf "https://raw.githubusercontent.com/wavesplatform/Waves/v${WAVES_VERSION}/waves-mainnet.conf" && \
curl -sLo /waves-testnet.conf "https://raw.githubusercontent.com/wavesplatform/Waves/v${WAVES_VERSION}/waves-testnet.conf"
FROM openjdk:8-jre-slim
MAINTAINER Andrey Andreev <andyceo@yandex.ru> (@andyceo)
COPY --from=crawler /waves.jar /waves.jar
COPY --from=crawler /waves-devnet.conf /waves-devnet.conf
COPY --from=crawler /waves-mainnet.conf /waves-mainnet.conf
COPY --from=crawler /waves-testnet.conf /waves-testnet.conf
EXPOSE 6869 6868
VOLUME ["/root/waves"]
RUN ["java", "-version"]
ENTRYPOINT ["/usr/bin/java", "-jar", "/waves.jar"]
CMD ["/waves-mainnet.conf"]
Removed all previous containers and clear Docker files:
docker rm -f `docker ps -a -q`; docker rmi waves-docker; docker system prune -f
Built an image from the directory with Dockerfile: docker build -t waves-docker:openjdk8 .
Ran a container: docker run --rm waves-docker:openjdk8
Got:
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-1~deb9u1-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
when build. And had no error when running.
Next, I tried other JRE's in a same way:
OpenJDK JRE 1.9: openjdk:9-jre-slim
with docker run --rm waves-docker:openjdk9
:
openjdk version "9.0.1"
OpenJDK Runtime Environment (build 9.0.1+11-Debian-1)
OpenJDK 64-Bit Server VM (build 9.0.1+11-Debian-1, mixed mode)
When ran:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/waves.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
But all seems work.
OracleJDK JRE 1.8: oracle/serverjre:8
with docker run --rm waves-docker:oraclejdk8
(see)
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
Works.
OracleJDK JRE 1.9: oracle/serverjre:9
with docker run --rm waves-docker:oraclejdk9
(see)
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
When ran:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/waves.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
But all seems work.
With OracleJDKs I have to change:
ENTRYPOINT ["/usr/bin/java", "-jar", "/waves.jar"]
to:
ENTRYPOINT ["java", "-jar", "/waves.jar"]
PS: Also we plan to distribute and maintain own Docker images in future.
Hello!
When I try to use your 0.9.2 release with Java 8 I get:
But node works fine with Java 9:
You documented that Waves need Java 8 here:
Also you did not mention anything about Java 9 in your Waves 0.9.2 release notes. Waves 0.8.10 worked fine with Java 8.
Please fix something, docs or node or both, I think your application must work with stable Java versions.