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

Set JAVA_HOME manually for amazoncorretto-debian images #454

Merged
merged 3 commits into from
Apr 1, 2024
Merged

Set JAVA_HOME manually for amazoncorretto-debian images #454

merged 3 commits into from
Apr 1, 2024

Conversation

anirbanmu
Copy link
Contributor

Fixes #452

I ended up doing it via a symlink of the deduced java home because sadly it seems you cannot use the result of running a shell command as the value for an ENV directive. See this issue.

@carlossg
Copy link
Owner

Isn't java home a known constant directory after package installation?

@anirbanmu
Copy link
Contributor Author

Isn't java home a known constant directory after package installation?

It should be mostly constant I'd think. I did it this way just in case the package installation decides to change the directory in the future.

If you think this is overkill, I can just hardcode the specific paths for each Corretto version? let me know, and I can push up an update.

@anirbanmu
Copy link
Contributor Author

Actually went ahead and changed the PR to just use hardcoded paths for JAVA_HOME. I think the simplicity is worth it and If it breaks in the future, we can fix it.

@carlossg
Copy link
Owner

carlossg commented Apr 1, 2024

the gpg removal is flaky, failing often with

#9 6.753 Running hooks in /etc/ca-certificates/update.d...
#9 6.754 done.
#9 6.778 gpg: keybox '/tmp/tmp.R31HI6uizI/pubring.kbx' created
#9 6.782   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#9 6.782                                  Dload  Upload   Total   Spent    Left  Speed
#9 6.782 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1695  100  1695    0     0   7522      0 --:--:-- --:--:-- --:--:--  7533
#9 7.010 gpg: /tmp/tmp.R31HI6uizI/trustdb.gpg: trustdb created
#9 7.010 gpg: key A122542AB04F24E3: public key "Amazon Services LLC (Amazon Corretto release) <[email protected]>" imported
#9 7.014 gpg: Total number processed: 1
#9 7.014 gpg:               imported: 1
#9 7.018 rm: cannot remove '/tmp/tmp.R31HI6uizI/S.gpg-agent.extra': No such file or directory
#9 ERROR: process "/bin/sh -c apt-get update   && apt-get install -y curl gnupg   && export GNUPGHOME=\"$(mktemp -d)\"   && curl -fL https://apt.corretto.aws/corretto.key | gpg --batch --import   && gpg --batch --export '6DC3636DAE534049C8B94623A122542AB04F24E3' > /usr/share/keyrings/corretto.gpg   && rm -r \"$GNUPGHOME\"   && unset GNUPGHOME   && echo \"deb [signed-by=/usr/share/keyrings/corretto.gpg] https://apt.corretto.aws/ stable main\" > /etc/apt/sources.list.d/corretto.list   && apt-get update   && apt-get remove --purge --autoremove -y curl gnupg   && apt-get install -y java-1.8.0-amazon-corretto-jdk   && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 1

@carlossg carlossg merged commit 5c5d19e into carlossg:main Apr 1, 2024
4 checks passed
@anirbanmu anirbanmu deleted the corretto-debian-java-home branch April 1, 2024 19:03
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

Successfully merging this pull request may close these issues.

$JAVA_HOME is missing on amazoncorretto-8-debian
2 participants