Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power architecture distroless images missing java in its PATH #1369

Open
cnnaik opened this issue Aug 7, 2023 · 10 comments
Open

Power architecture distroless images missing java in its PATH #1369

cnnaik opened this issue Aug 7, 2023 · 10 comments

Comments

@cnnaik
Copy link

cnnaik commented Aug 7, 2023

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

@lathama
Copy link
Contributor

lathama commented Aug 7, 2023

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

@cnnaik
Copy link
Author

cnnaik commented Aug 8, 2023

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

@cnnaik
Copy link
Author

cnnaik commented Aug 8, 2023

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

@cnnaik
Copy link
Author

cnnaik commented Aug 9, 2023

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

@lathama
Copy link
Contributor

lathama commented Aug 9, 2023

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

@cnnaik
Copy link
Author

cnnaik commented Aug 10, 2023

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
Copy link
Author

cnnaik commented Aug 14, 2023

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

@cnnaik
Copy link
Author

cnnaik commented Aug 18, 2023

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

@loosebazooka
Copy link
Member

@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.

@cnnaik
Copy link
Author

cnnaik commented Aug 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants