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

Utilize Dockerized jdk over Ubuntu JDK #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# With thanks to David Bowes ([email protected]) who did all the hard work
# on this originally.

# grab openjdk-16 container first, then ubuntu 20.04 base image
FROM openjdk:16-jdk AS jdk
FROM docker.io/ubuntu:20.04

# https://github.com/opencontainers/image-spec/blob/master/annotations.md
Expand All @@ -19,8 +21,16 @@ ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV JAVA_HOME /usr/lib/jvm/java-16-openjdk-amd64
ENV LANG C.UTF-8

# Copy OpenJDK into Ubuntu container and setup via update-alternatives
COPY --from=jdk /usr/java/openjdk-16 /usr/lib/jvm/java-16-openjdk-amd64
RUN update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-16-openjdk-amd64/bin/java 20 && \
update-alternatives --auto java && \
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-16-openjdk-amd64/bin/javac 20 && \
update-alternatives --auto javac

# Copy apache virtual host file for later use
COPY 000-jobe.conf /
# Copy test script
Expand All @@ -45,7 +55,6 @@ RUN ln -snf /usr/share/zoneinfo/"$TZ" /etc/localtime && \
libapache2-mod-php \
nodejs \
octave \
openjdk-16-jdk \
php \
php-cli \
php-mbstring \
Expand Down