9

I have written a dockerfile for creating selenium image with debian base image While I am installing JDK11,I am seeing these errors.enter image description here

RUN apt-get upgrade
RUN apt-get update
RUN apt-get -y install apt-transport-https curl
RUN apt-get -qqy --no-install-recommends install bzip2
RUN apt-get -qqy --no-install-recommends install ca-certificates
RUN mkdir -p /usr/share/man/man1
RUN apt-get -qqy --no-install-recommends install openjdk-11-jre-headless
RUN apt-get -qqy --no-install-recommends install ca-certificates-java
RUN dpkg --list | grep java
RUN apt-get -qqy --no-install-recommends install sudo
RUN apt-get -qqy --no-install-recommends install unzip
RUN apt-get -qqy --no-install-recommends install gdebi-core
COPY files/chrome/google-chrome_amd64.deb /google-chrome_amd64.deb
RUN gdebi --n /google-chrome_amd64.deb
RUN apt-get -qqy install xvfb
RUN rm -rf /var/lib/apt/lists/* /var/cache/apt/*
RUN echo $(ls ./usr/lib/jvm/java-11-openjdk-amd64/lib/security)

This is the docker file i am using

  • 2
    A note in passing: `try to reduce the number of layers in your image by minimizing the number of separate RUN commands in your Dockerfile.` − https://docs.docker.com/develop/dev-best-practices/ – ErikMD Apr 19 '20 at 14:34

2 Answers2

5

Seems related to this bug:
https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/1998065

Try to install ca-certificates-java before java, e.g.:

apt-get install ca-certificates-java openjdk-11-jre-headless
Oleksandr Shmyrko
  • 1,720
  • 17
  • 22
4

It's some layering issue I read somewhere else online. Don't know much about that. But that pointed me toward a usable fix: remove the folder and recreate it.

rmdir /etc/ssl/certs/java
mkdir /etc/ssl/certs/java

Now the install should work.

odinho - Velmont
  • 20,922
  • 6
  • 41
  • 33