From Spring Microservices in Action book: I am trying to use the Docker Maven Plugin to build a docker image for deploy a Java microservice as Docker container to the cloud.
Dockerfile:
FROM openjdk:8-jdk-alpine
RUN mkdir -p /usr/local/configserver
ADD jce_policy-8.zip /tmp/
RUN unzip /tmp/jce_policy-8.zip && \
rm /tmp/jce_policy-8.zip && \
yes | cp -v /tmp/UnlimitedJCEPolicyJDK8/*.jar /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/
ADD @[email protected] /usr/local/configserver/
ADD run.sh run.sh
RUN chmod +x run.sh
CMD ./run.sh
Output related to step 4 in Dockerfile:
... ---> Using cache ---> dd33d4c12d29 Step 4/8 : RUN unzip /tmp/jce_policy-8.zip && rm /tmp/jce_policy-8.zip && yes | cp -v /tmp/UnlimitedJCEPolicyJDK8/*.jar /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/ ---> Running in 1071273ceee5 Archive: /tmp/jce_policy-8.zip unzip: short read
Why do I get unzip: short read
when I try to build the image?
Maybe it is related to the fact that the unzip
command in alpine is provided busybox and not the standard unzip tool.
Busybox do have bugs related to this error: https://bugs.busybox.net/show_bug.cgi?id=8821
Here is a related issue with more details: https://github.com/wahern/luaossl/issues/103
As a workaround installing the standard unzip
command should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With