corretto / corretto-docker

Dockerfiles for Amazon Corretto Official images.
https://hub.docker.com/_/amazoncorretto
MIT No Attribution
157 stars 66 forks source link

amazoncorretto:8-alpine-jre java symlink is bad #92

Closed fasher closed 2 years ago

fasher commented 2 years ago

Thank you for taking the time to help improve Corretto.

If your request concerns a security vulnerability then please report it by email to aws-security@amazon.com instead of here. (You can find more information regarding security issues at https://aws.amazon.com/security/vulnerability-reporting/.)

If your issue is specific to the Amazon Linux image these containers are built upon, please, consider opening an issue on the Amazon Linux Docker github repository

If your issue is specific to Corretto docker images, then you are in the right place. Please proceed with the following.

Describe the bug

the containter java symlink is orphan

To Reproduce

docker run --rm -it --name thekindkeptn amazoncorretto:8-alpine-jre /usr/bin/java docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/bin/java": stat /usr/bin/java: no such file or directory: unknown.

~ at ☸️ mssdev-ingest-usw2 (mss-worker) ➜ docker run --rm -it --name thekindkeptn amazoncorretto:8-alpine-jre ls -l /usr/bin/java lrwxrwxrwx 1 root root 31 Mar 23 15:46 /usr/bin/java -> ../lib/jvm/default-jvm/bin/java

~ at ☸️ mssdev-ingest-usw2 (mss-worker) ➜ docker run --rm -it --name thekindkeptn amazoncorretto:8-alpine-jre ls -l ls -l /usr/lib/default-jvm/ bin/java ls: ls: No such file or directory ls: /usr/lib/default-jvm/bin/java: No such file or directory

Expected behavior

/usr/bin/java should be available on the container

Screenshots

If applicable, add screenshots to help explain your problem.

Platform information

Repository: dockerhun
Image tag: 8-alpine-jre

Additional context

Add any other context about the problem here.

lutkerd commented 2 years ago

Thanks for reporting this issue. It seems that Alpine published a new base image for 3.15.2 that includes a change to java-common that moved where it symlinks files to. We'll have to investigate further and figure out the next steps.

See https://git.alpinelinux.org/aports/commit/?h=v3.15.2&id=5a0989e44934a86048b18b4253ec220cbd07f90f

@@ -13,6 +13,6 @@ triggers="java-common.trigger=/usr/lib/jvm"
 package() {
    mkdir -p "$pkgdir"/usr/bin
    for exe in jaotc jar jarsigner java javac javadoc javap jcmd jdb jdeprscan jdeps jexec jexec-binfmt jfr jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool pack200 rmic rmid rmiregistry serialver unpack200; do
-       ln -sf ../lib/jvm/default-jvm/jre/bin/$exe "$pkgdir"/usr/bin
+       ln -sf ../lib/jvm/default-jvm/bin/$exe "$pkgdir"/usr/bin
    done
 }
lutkerd commented 2 years ago

The issue only seems to affect the 8-alpine-jre and not the jdk/full images. We think we know where the problem is and will have to build and test new packages.

TianminShi commented 2 years ago

confirmed only amazoncorretto:8-alpine3.15-jre is effected by this change now. and tag amazoncorretto:8-alpine-jre is equivalent to tag amazoncorretto:8-alpine3.15-jre

TheHydGuy commented 2 years ago

Thank you for the update! Do we have any ETA available at this time or any work around to mitigate the issue until it is solved. Any help is highly appreciated.

TianminShi commented 2 years ago

here is quick workaround to fix this. docker run -it amazoncorretto:8-alpine-jre ln -s -f /usr/lib/jvm/default-jvm/jre/bin/java /usr/bin/java&&/usr/bin/java and we are working on fixing this in our docker hub image

lutkerd commented 2 years ago

To update to the official image was just merged and new images are usually available within ~4 hours. https://github.com/docker-library/official-images/pull/12110

This part is on DockerHub and we have no control over the timeframe.

lutkerd commented 2 years ago

New image is posted and working

$ docker run -it amazoncorretto:8u322-alpine3.15-jre java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment Corretto-8.322.06.2 (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM Corretto-8.322.06.2 (build 25.322-b06, mixed mode)

We will also be fixing this at the APK level and publishing new packages.

lutkerd commented 2 years ago

New packages are available, closing resolved issue.