-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial dockerfiles for openjdk 8u222, openjfx 8, sbt 1.3.0 and scala…
… 2.13.0
- Loading branch information
1 parent
0e826ab
commit 826b91a
Showing
4 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,2 +1,7 @@ | ||
# docker-openjdk-javafx-sbt | ||
Docker files for OpenJDK with JavaFX and SBT | ||
Docker files for OpenJDK with JavaFX and SBT. Inspired by https://github.com/hseeberger/scala-sbt/ but simpler and is primarily intented for **building** your projects, eg CI and so on. | ||
|
||
There are three options: | ||
- image-amazon = [Amazon Corretto](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/docker-install.html) (which already includes OpenJFX) + SBT | ||
- image-debian = pure Debian + OpenJDK JDK + OpenJFX + SBT, **recommended** | ||
- image-openjdk = similar to image-debian but based on official openjdk image, however OpenJFX installation is hacky |
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Amazon Corretto 8 provides JavaFX out-of-the-box | ||
FROM amazoncorretto:8u222 | ||
|
||
# The following is inspired by https://github.com/hseeberger/scala-sbt/blob/master/oracle/Dockerfile | ||
ENV SCALA_VERSION 2.13.0 | ||
ENV SBT_VERSION 1.3.0 | ||
|
||
# Install sbt | ||
RUN \ | ||
curl -L -o /root/sbt-${SBT_VERSION}.rpm https://bintray.com/sbt/rpm/download_file?file_path=sbt-${SBT_VERSION}.rpm && \ | ||
yum install -y /root/sbt-${SBT_VERSION}.rpm && \ | ||
yum clean all && \ | ||
rm /root/sbt-${SBT_VERSION}.rpm | ||
|
||
# Prepare sbt and Scala, verify compilation including JavaFX classes | ||
WORKDIR /root/dummy | ||
RUN \ | ||
mkdir -p project && \ | ||
echo "scalaVersion := \"${SCALA_VERSION}\"" > build.sbt && \ | ||
echo "sbt.version=${SBT_VERSION}" > project/build.properties && \ | ||
echo -e 'import java.nio.file.Path\nimport javafx.application.Application\ncase object Temp' > Temp.scala && \ | ||
sbt compile && \ | ||
rm -rf /root/dummy | ||
|
||
WORKDIR /root |
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Debian Stretch provides proper openjfx version for Java 8 | ||
FROM buildpack-deps:stretch-scm | ||
|
||
# Install OpenJDK JDK and OpenJFX | ||
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-8-jdk openjfx && rm -rf /var/lib/apt/lists/* | ||
|
||
# The following is inspired by https://github.com/hseeberger/scala-sbt/blob/master/debian/Dockerfile | ||
ENV SCALA_VERSION 2.13.0 | ||
ENV SBT_VERSION 1.3.0 | ||
RUN \ | ||
curl -L -o /root/sbt-${SBT_VERSION}.deb https://dl.bintray.com/sbt/debian/sbt-${SBT_VERSION}.deb && \ | ||
apt-get install -y /root/sbt-${SBT_VERSION}.deb && \ | ||
rm /root/sbt-${SBT_VERSION}.deb | ||
|
||
# Prepare sbt and Scala, verify compilation including JavaFX classes | ||
WORKDIR /root/dummy | ||
RUN \ | ||
mkdir -p project && \ | ||
echo "scalaVersion := \"${SCALA_VERSION}\"" > build.sbt && \ | ||
echo "sbt.version=${SBT_VERSION}" > project/build.properties && \ | ||
echo 'import java.nio.file.Path\nimport javafx.application.Application\ncase object Temp' > Temp.scala && \ | ||
sbt compile && \ | ||
rm -rf /root/dummy | ||
|
||
WORKDIR /root |
This file contains 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Debian Stretch provides proper openjfx version for Java 8 | ||
FROM openjdk:8u222-jdk-stretch | ||
|
||
# Install OpenJFX as per https://github.com/docker-library/openjdk/issues/158 | ||
RUN apt-get update && apt-get install -y --no-install-recommends openjfx && rm -rf /var/lib/apt/lists/* | ||
|
||
# The following is inspired by https://github.com/hseeberger/scala-sbt/blob/master/debian/Dockerfile | ||
ENV SCALA_VERSION 2.13.0 | ||
ENV SBT_VERSION 1.3.0 | ||
RUN \ | ||
curl -L -o /root/sbt-${SBT_VERSION}.deb https://dl.bintray.com/sbt/debian/sbt-${SBT_VERSION}.deb && \ | ||
apt-get install -y /root/sbt-${SBT_VERSION}.deb && \ | ||
rm /root/sbt-${SBT_VERSION}.deb | ||
|
||
# Fix OpenJFX installation for local JDK | ||
RUN \ | ||
ln -s -t "$JAVA_HOME/jre/lib/" $(find /usr/share/java/openjfx/jre/lib/ -maxdepth 1 -type f) && \ | ||
ln -s -t "$JAVA_HOME/jre/lib/ext/" $(find /usr/share/java/openjfx/jre/lib/ext/ -maxdepth 1 -type f) | ||
|
||
# Prepare sbt and Scala, verify compilation including JavaFX classes | ||
WORKDIR /root/dummy | ||
RUN \ | ||
mkdir -p project && \ | ||
echo "scalaVersion := \"${SCALA_VERSION}\"" > build.sbt && \ | ||
echo "sbt.version=${SBT_VERSION}" > project/build.properties && \ | ||
echo 'import java.nio.file.Path\nimport javafx.application.Application\ncase object Temp' > Temp.scala && \ | ||
sbt compile && \ | ||
rm -rf /root/dummy | ||
|
||
WORKDIR /root |