Issue
I'm trying to install Java in a docker image in order to make working with firebase a bit easier.
When running the installation command I get the following error:
Unable to locate package openjdk-11-jre-headless
Here is the docker image definition:
FROM node:14.5
ADD . /src
WORKDIR /src
# Install OpenJDK-11
RUN apt-get update && \
apt-get install -y openjdk-11-jre-headless && \
apt-get clean;
RUN npm i -g firebase-tools
RUN firebase --version
RUN firebase emulators:start
EXPOSE 4400 4500 5000 5001 8001 8080 8085 9000
Solution
I guess the node image is based on debian which does not have the repository by default.
Adding the following got it working for me:
RUN echo 'deb http://ftp.debian.org/debian stretch-backports main' | tee /etc/apt/sources.list.d/stretch-backports.list
Answered By - melchoir55
Answer Checked By - Katrina (JavaFixing Volunteer)