distroless icon indicating copy to clipboard operation
distroless copied to clipboard

Power architecture distroless images missing java in its PATH

Open cnnaik opened this issue 2 years ago • 10 comments

Describe the bug I was trying to create a dockerfile using [gcr.io/distroless/java17-debian11:nonroot-ppc64le]. The dockerfile builds successfully, however while I try to create a container for this image the container creation fails as java is not available for power architecture. Tried to create a container by just pulling distroless image, results in same error. Can u please verify this and provide a workaround for us to use this image.

To Reproduce

  1. Create container with the power supported distroless image docker run --entrypoint java gcr.io/distroless/java17-debian11:debug-ppc64le --version

Expected behavior Container should be created and java version should be printed.

Console Output Error logs are here for all image variants tried on power:

docker run --entrypoint java [gcr.io/distroless/java17-debian11:latest-ppc64le](http://gcr.io/distroless/java17-debian11:latest-ppc64le) --version
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "java": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled
docker run --entrypoint java [gcr.io/distroless/java17-debian11:nonroot-ppc64le](http://gcr.io/distroless/java17-debian11:nonroot-ppc64le) --version
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "java": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled
docker run --entrypoint java [gcr.io/distroless/java17-debian11:debug-ppc64le](http://gcr.io/distroless/java17-debian11:debug-ppc64le) --version
Status: Downloaded newer image for [gcr.io/distroless/java17-debian11:debug-ppc64le](http://gcr.io/distroless/java17-debian11:debug-ppc64le)
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "java": executable file not found in $PATH: unknown.
ERRO[0040] error waiting for container: context canceled

``

On x86:

docker run --entrypoint  java gcr.io/distroless/java17-debian11 -version
Unable to find image 'gcr.io/distroless/java17-debian11:latest' locally
latest: Pulling from distroless/java17-debian11
a7ca0d9ba68f: Already exists
fe5ca62666f0: Already exists
b02a7525f878: Already exists
fcb6f6d2c998: Already exists
e8c73c638ae9: Already exists
1e3d9b7d1452: Already exists
4aa0ea1413d3: Already exists
7c881f9ab25e: Already exists
5627a970d25e: Already exists
96266735468f: Already exists
2758d0c31c8c: Already exists
08553ba93cfe: Already exists
dfc02eb7708f: Already exists
52907d314ddc: Already exists
4eec690774a4: Already exists
675146cb6c2a: Already exists
910ee57fcf41: Already exists
8d8296c797d5: Already exists
19d7a7929808: Already exists
a206920495e4: Already exists
96b7da183dde: Already exists
3fae29597e57: Already exists
39b3a91fc2a1: Already exists
92ba987dc303: Already exists
b730362a7682: Already exists
6ade147a9615: Already exists
ddc440aca81f: Already exists
8e56075833f1: Already exists
abaeef7507fc: Already exists
c1a0d25e8eb6: Already exists
30ca9fadd5d5: Already exists
43c7367a6b72: Already exists
306fe1b1f602: Already exists
cafbc308d99e: Already exists
Digest: sha256:672df6324b5e36527b201135c37c3ed14579b2eb9485a4f4e9ab526d466f671c
Status: Downloaded newer image for gcr.io/distroless/java17-debian11:latest
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1deb11u1, mixed mode, sharing)

Additional context found a similar issue here - Java 11 and 17 multiarch debug images missing java · Issue #906 · GoogleContainerTools/distroless (github.com

cnnaik avatar Aug 07 '23 06:08 cnnaik

I see lr-xr-xr-x 0/0 0 1999-12-31 17:00 usr/bin/java -> /usr/lib/jvm/java-17-openjdk-ppc64le/bin/java

You may want to use the full path on your entrypoint

$ docker pull gcr.io/distroless/java17-debian11:nonroot-ppc64le $ docker save gcr.io/distroless/java17-debian11:nonroot-ppc64le -o mytarball.tar $ tar -tvf myrarball.tar

I looked at the largest tarball and saw the above pasted entry

lathama avatar Aug 07 '23 15:08 lathama

Thanks @lathama for the inputs, we will check this and update.

cnnaik avatar Aug 08 '23 03:08 cnnaik

@lathama After adding above full java path in entrypoint there is same observation, the error still persists.

cnnaik avatar Aug 08 '23 04:08 cnnaik

@lathama , Team, Can you please point to the steps for building this distroless docker image locally? Looks like it uses bazel build.

cnnaik avatar Aug 09 '23 04:08 cnnaik

There are some instructions on the README. I lack access to PPC or otherwise I would do some validation.

https://github.com/GoogleContainerTools/distroless#bazel

lathama avatar Aug 09 '23 16:08 lathama

There are some instructions on the README. I lack access to PPC or otherwise I would do some validation.

https://github.com/GoogleContainerTools/distroless#bazel

@lathama I will go through the link you have provided.

Getting a ppc64le node/vm can be done via a opensource community based VM request form - https://osuosl.org/services/powerdev/request_hosting/ . Please put in Gerrit Huizenga as the IBM Advocate while filling up the form. Please let us know if this works to get access to a power instance.

cnnaik avatar Aug 10 '23 08:08 cnnaik

@lathama Could you please try to get the power instance for validation at your end and update us?

cnnaik avatar Aug 14 '23 05:08 cnnaik

@lathama Could you please look into getting power instance for validation.

cnnaik avatar Aug 18 '23 05:08 cnnaik

@cnnaik please be advised that @lathama is a community member who may or may not have time to work on this. It would be more helpful if you could debug this problem on your side and update this project with details.

loosebazooka avatar Aug 18 '23 11:08 loosebazooka

Ok thanks for the update @loosebazooka. We will try to work on it.

cnnaik avatar Aug 22 '23 06:08 cnnaik