I am new to docker, and I need help to build corretto 17 alpine linux image.
I have an existing docker file which build java jdk 8 alpine linux image as below.
FROM alpine:3.17
# install software
RUN apk add --no-cache
bash
openjdk8-jre
How can I add corretto 17 command to this docker file to run my application on corretto 17.
Thanks
2
Answers
I found an aws doc to install Amazon Corretto 17 on Alpine Linux
below is the command that neet to insert in your docker file to install corretto 17.
An approach, based on my comment in this answer:
Use the following to use one of the official Corretto Java images – in this case, using Alpine:
and then
Or, if you want a
Dockerfile
:If I build the image using this…
…then I can run it with:
And the
run
output is:This obviously doesn’t do anything useful, except to show the Java details.