Hi i need to build python:3.7-slim-stretch docker image with java
Here my Dockerfile :
FROM python:3.7-slim-stretch
# Install OpenJDK-8
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME
But i'm getting this error when i build it :
...
update-alternatives: error: error creating symbolic link '/usr/share/man/man1/rmid.1.gz.dpkg-tmp': No such file or directory
dpkg: error processing package openjdk-8-jre-headless:amd64 (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of ca-certificates-java:
dpkg: error processing package openjdk-8-jdk:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-8-jre:amd64:
openjdk-8-jre:amd64 depends on openjdk-8-jre-headless (= 8u232-b09-1~deb9u1); however:
Package openjdk-8-jre-headless:amd64 is not configured yet.
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update && apt-get install -y openjdk-8-jdk && apt-get install -y ant && apt-get clean;' returned a non-zero code: 100
Any idea ?
Thanks
add this to your dockerfile before insatll :
RUN mkdir -p /usr/share/man/man1/
you may also remove RUN export JAVA_HOME since it has no effect in Dockerfile
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