6

I am trying to install the java runtime in a Debian based docker image (mcr.microsoft.com/dotnet/core/sdk:3.1-buster). According to various howtos this should be possible by running

RUN apt update
RUN apt-get install openjdk-11-jre

The latter command comes back with

E: Unable to locate package openjdk-11-jre

However according to https://packages.debian.org/buster/openjdk-11-jre the package does exist. What am I doing wrong?

1 Answer 1

20

Unsure from which image your are pulling. I used slim, Dockerfile.

from debian:buster-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN mkdir -p /usr/share/man/man1 /usr/share/man/man2

RUN apt-get update && \
apt-get install -y --no-install-recommends \
        openjdk-11-jre

# Prints installed java version, just for checking
RUN java --version

NOTE: If you don't run the mkdir -p /usr/share/man/man1 /usr/share/man/man2 you'll run into dependency problems with ca-certificates, openjdk-11-jre-headless etc. I've been using this fix provided by community, haven't really checked the permanent fix.

Sign up to request clarification or add additional context in comments.

2 Comments

Turns out this was a network related issue, it is working now. Thanks anyway.
You NOTE saved my day. Thx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.