How to add jdk17 in Docker run command in amazon extras in Dockerfile?

891 Views Asked by At

I am trying to use the amazon linux and installing amazon extras, Here is my Dockerfile,

FROM amazonlinux:2

# Install CloudHSM client
RUN yum install -y https://s3.amazonaws.com/cloudhsmv2-software/CloudHsmClient/EL7/cloudhsm-client-3.4.4-1.el7.x86_64.rpm

# Install CloudHSM Java library
RUN yum install -y https://s3.amazonaws.com/cloudhsmv2-software/CloudHsmClient/EL7/cloudhsm-client-jce-3.4.4-1.el7.x86_64.rpm

# Install Java 11
RUN amazon-linux-extras install -y java-openjdk11

When I replace the run command with following 
RUN amazon-linux-extras install -y java-openjdk17
It fails, I get error as java-openjdk17 not found. Please help.


# Install Java 11
RUN amazon-linux-extras install -y java-openjdk11

When I replace the run command with following

RUN amazon-linux-extras install -y java-openjdk17

It fails, I get error as java-openjdk17 not found. Please help.

1

There are 1 best solutions below

0
On

You can update install to this

RUN amazon-linux-extras install -y java-17-amazon-corretto.x86_64