-
Notifications
You must be signed in to change notification settings - Fork 473
Add explicit JAVA_HOME environment variable #61
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ed7e793
added JAVA_HOME environment variable
soupdiver e856a9e
Generate Dockerfiles for stronger consistency
tianon c046a7d
Add a "docker-java-home" script and use it to verify our hard-coded "…
tianon a2495c5
Add some minor optimization in "update.sh" so we only make half as ma…
tianon 5552e0c
Whoo, openjdk-9 "fixed" JAVA_HOME so we don't have a strange mismatch…
tianon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
FROM buildpack-deps:sid-curl | ||
# | ||
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" | ||
# | ||
# PLEASE DO NOT EDIT IT DIRECTLY. | ||
# | ||
|
||
FROM buildpack-deps:sid-scm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Managed to catch an amusing oversight here, too. 😄 |
||
|
||
# A few problems with compiling Java from source: | ||
# 1. Oracle. Licensing prevents us from redistributing the official JDK. | ||
|
@@ -12,6 +18,18 @@ RUN echo 'deb http://httpredir.debian.org/debian experimental main' > /etc/apt/s | |
# Default to UTF-8 file.encoding | ||
ENV LANG C.UTF-8 | ||
|
||
# add a simple script that can auto-detect the appropriate JAVA_HOME value | ||
# based on whether the JDK or only the JRE is installed | ||
RUN { \ | ||
echo '#!/bin/bash'; \ | ||
echo 'set -e'; \ | ||
echo; \ | ||
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ | ||
} > /usr/local/bin/docker-java-home \ | ||
&& chmod +x /usr/local/bin/docker-java-home | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-9-openjdk-amd64 | ||
|
||
ENV JAVA_VERSION 9~b96 | ||
ENV JAVA_DEBIAN_VERSION 9~b96-1 | ||
|
||
|
@@ -24,14 +42,11 @@ RUN set -x \ | |
&& apt-get install -y \ | ||
openjdk-9-jdk="$JAVA_DEBIAN_VERSION" \ | ||
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& [ "$JAVA_HOME" = "$(docker-java-home)" ] | ||
|
||
# see CA_CERTIFICATES_JAVA_VERSION notes above | ||
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure | ||
|
||
# see https://bugs.debian.org/793210 | ||
# and https://github.com/docker-library/java/issues/46#issuecomment-119026586 | ||
RUN apt-get update && apt-get install -y --no-install-recommends libfontconfig1 && rm -rf /var/lib/apt/lists/* | ||
|
||
# If you're reading this and have any feedback on how this image could be | ||
# improved, please open an issue or a pull request so we can discuss it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bug is officially fixed, and the fix is included in the
openjdk-8
packages injessie-backports
. 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤘