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

Adding Dockerfile and bash scripts to build and run Docker containers #93

Merged
merged 88 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
9d41f78
Adding Dockerfile and bash scripts to build and run Docker containers
neomatrix369 Sep 29, 2021
96d2493
Replaced old method of building and running Docker image for graalvm-…
neomatrix369 Sep 29, 2021
d50bb75
Minor changes: use full graalvm version information, and apply it to …
neomatrix369 Sep 29, 2021
8ce10f2
Updated the master README with instructions on how to use the docker …
neomatrix369 Sep 29, 2021
a3c9ce5
Cosmetic: Amend the display message about GraalVM image. Install the …
neomatrix369 Sep 29, 2021
c4bd32d
Multiple changes:
neomatrix369 Sep 29, 2021
2f46b7a
Adding comments to the Dockerfile
neomatrix369 Sep 29, 2021
6813be8
hello-graal example: Adding a couple of files to ignore
neomatrix369 Sep 29, 2021
338d0d4
native-list-dir example: Adding a couple of files to the git ignore list
neomatrix369 Sep 29, 2021
588fd17
Cosmetic changes to the Dockerfile
neomatrix369 Sep 29, 2021
7077556
Mount .m2 folder outside the container, make JAVA_HOME, same as GRAAL…
neomatrix369 Sep 29, 2021
55cf1ae
Separated wrk and micronaut-starter binaries into separate docker bas…
neomatrix369 Sep 30, 2021
c3f6cc0
Moved docker-related Dockerfiles and shellscript into a separate folder
neomatrix369 Sep 30, 2021
fcc2b38
README: updated the master README.md with the new path to the buildDo…
neomatrix369 Sep 30, 2021
bcf2fbf
Adding macOS related file to ignore
neomatrix369 Sep 30, 2021
bdffc2a
.gitignore: Consolidating two folders and replacing it with the paren…
neomatrix369 Sep 30, 2021
ca75d25
Comments: added minor comments to help with finding tags for GraalVM …
neomatrix369 Sep 30, 2021
b7033ce
Install jmeter to the image, open ports 8081 and 8443 to docker host,…
neomatrix369 Sep 30, 2021
2025341
Adding scala and sbt to the image, setting SCALA_HOME and also mappin…
neomatrix369 Sep 30, 2021
0306773
Adding some more filenames/patterns to the git ignore list
neomatrix369 Sep 30, 2021
6dec766
Dockerfile: minor corrections (comment on a new line), setting the MI…
neomatrix369 Sep 30, 2021
55446ca
Replaced old ways of installing Scala and sbt with newer way, it's al…
neomatrix369 Oct 1, 2021
56c2e7b
Refactored docker related files and the order in which components are…
neomatrix369 Oct 1, 2021
763cede
GraalVM Version Parameter: simplified the way the full GraalVM Versio…
neomatrix369 Oct 3, 2021
de39c64
Tag the micronaut/starter docker image version with the graalvm versi…
neomatrix369 Oct 3, 2021
50f0c20
Shell scripts: checking the passed in GraalVM version tag parameter f…
neomatrix369 Oct 3, 2021
4cb2e49
Test and update Native jshell and Espresso demo
olyagpl Sep 29, 2021
f9d0f62
Remove the demo as per agreement
olyagpl Oct 1, 2021
42956dc
Review and update FunctionGraph Demo
olyagpl Oct 1, 2021
433ca58
Review Galaaz Demo
olyagpl Oct 1, 2021
6c6295b
Review and update GraalVM Demos: Hello Graal
olyagpl Oct 1, 2021
b1eebd2
Review and update Java Kotlin Interoperability and AOT Compilation Demo
olyagpl Oct 1, 2021
aa42100
Review and update java-simple-stream-benchmark and native-list-dir demos
olyagpl Oct 5, 2021
7105d93
Test and update js-java-async-helidon demo
olyagpl Oct 7, 2021
c5cc57e
Test and update Micronaut Demo with Python for Data Visualization
olyagpl Oct 7, 2021
44939e6
Fix formatting
olyagpl Oct 7, 2021
d3c3db7
Remove MLE demo folder. Check the website examples for it
olyagpl Oct 7, 2021
6c3e2fa
Test and update multithreading-demo, native-list-dir demos
olyagpl Oct 7, 2021
f8be6f6
Test and update multithreading-demo, native-image-configure-examples,…
olyagpl Oct 7, 2021
8cec0d8
Test Micronaut with GraalVM Native Image and Docker
olyagpl Oct 8, 2021
c94aaef
Test and update spring-r, polyglot-javascript-java-r, native-image-wo…
olyagpl Oct 8, 2021
8754b28
Test and update scala-examples
olyagpl Oct 8, 2021
b037cc7
Merge branch 'master' into provide-Docker-scripts
neomatrix369 Oct 8, 2021
931ad42
Adding Gradle build step to the Docker steps
neomatrix369 Oct 8, 2021
6736914
GRAALVM_HOME: changing all references from GRAALVM_HOME to JAVA_HOME,…
neomatrix369 Oct 8, 2021
9a84d98
Amending maven version to 3.8.3, hiding unneeded echoes from sbt -ver…
neomatrix369 Oct 8, 2021
ba0bf08
GUI apps: with the enhanced version the previous docker container, it…
neomatrix369 Oct 9, 2021
610ee5c
Added numpy to the list of packages to be installed by ginstall when …
neomatrix369 Oct 9, 2021
fad1795
micronaut-python: fixed by adding the javax.inject package to the bui…
neomatrix369 Oct 9, 2021
4c0f1dd
Removing the check for image as this is already done when docker buil…
neomatrix369 Oct 11, 2021
57c03d3
Adding >&2 to echo-s in the two shellscripts, helps when running on e…
neomatrix369 Oct 11, 2021
857a2e8
Add a note in the README on how to access GUI-apps via a VNCViewer
neomatrix369 Oct 11, 2021
e02a9ed
DockerHub source: converting the scripts (and docs) to refer to Graal…
neomatrix369 Oct 11, 2021
cd59f1a
README: Updating instructions on how to invoke the GUI interface via …
neomatrix369 Oct 11, 2021
84d7286
graalpython-notebook-example: removed 'numpy' from pom.xml as it's no…
neomatrix369 Oct 11, 2021
ded0556
gu: adding R to the list of gu installation steps
neomatrix369 Oct 11, 2021
714e155
TruffleRuby: install TruffleRuby, a couple of dependencies and patch …
neomatrix369 Oct 11, 2021
c474bdf
native-image: install native-image in the docker image, using the gu …
neomatrix369 Oct 11, 2021
fdccdc7
GUI apps: adding linux dependencies to support GUI apps
neomatrix369 Oct 11, 2021
4f9ed94
Older demos: temporarily adding the GRAALVM_DIR env variable to the d…
neomatrix369 Oct 11, 2021
80dcd85
Adding a couple of items to the ignore list: wheel files and fastR-ex…
neomatrix369 Oct 11, 2021
0b162ed
Added the additional Linux dependencies for graalpython
neomatrix369 Oct 12, 2021
9d32061
Fix scalac demos
vjovanov Oct 12, 2021
1b56c28
Docker: amending the Docker related scripts to now take into account …
neomatrix369 Oct 12, 2021
32bb9f4
Ruby: be able to run post_install_hook.sh on both older and newer Gra…
neomatrix369 Oct 13, 2021
f1df974
Amend the gui based image to install dependencies for TruffleRuby, an…
neomatrix369 Oct 13, 2021
0e3505d
Merge branch 'master' into provide-Docker-scripts
neomatrix369 Oct 13, 2021
c938fe7
Moving gcc and make installation from the gui image to the console-ba…
neomatrix369 Oct 13, 2021
7f0b92a
Removing the remaining deleted files in the micronaut-python folder
neomatrix369 Oct 14, 2021
8b91f12
Reinstating GRAALVM_HOME till all demos test fine
neomatrix369 Oct 14, 2021
ef6ef25
Adding flag to enable stack trace when native-image building fails, a…
neomatrix369 Oct 14, 2021
2e1470e
Moved the step that runs the rebuilding of Ruby to the console part o…
neomatrix369 Oct 14, 2021
f03fbea
Use env variable GRAALVM_HOME instead of a mix of other env variables…
neomatrix369 Oct 14, 2021
0bcf891
Build base docker image using debian:buster in place of buildpack-dep…
neomatrix369 Oct 14, 2021
5ac240e
Install locale in a sequence that ruby's 'gem install' can pick the n…
neomatrix369 Oct 14, 2021
8b7e9d5
Install bzip2 for the ruby demo. Check for xxx-demo and xxx-demo-gui …
neomatrix369 Oct 14, 2021
0464af4
Ruby: adding a simple test to verify the steps/process involved in th…
neomatrix369 Oct 18, 2021
674fac4
Python: adding a simple test to verify the steps/process involved in …
neomatrix369 Oct 18, 2021
cc0e47e
Ruby: removing the unneeded comma when installing the ruby gems
neomatrix369 Oct 18, 2021
ea0a6c8
graalpython demo: update the install-deps shellscript to use /home/sa…
neomatrix369 Oct 18, 2021
608c5be
Adding the venv folder to the ignore list
neomatrix369 Oct 18, 2021
fb75893
curl: installing ca-certificates so commands like wget and curl do no…
neomatrix369 Oct 18, 2021
b6011bf
graalpython demo: updating the README to include an additional step t…
neomatrix369 Oct 18, 2021
3e36c7c
Docker image check: display download image progress while image is be…
neomatrix369 Oct 19, 2021
fef2d92
R: adding the libc++-dev depencency to help with the galaaz-ggplot de…
neomatrix369 Oct 19, 2021
2ef8d3a
Adding files to the ignore list after runnin espresso and native-list…
neomatrix369 Oct 19, 2021
36f1c47
ca-certs: moving the ca-certificates package to the higher docker ima…
neomatrix369 Oct 19, 2021
38afd46
Changing GRAALVM_HOME to /opt/graalvm and using the variable when cop…
neomatrix369 Oct 19, 2021
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
shared
_dot_gradle_folder
_dot_m2_folder
.git
.gitmodules
.idea
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,46 @@ typings/
# dotenv environment variables file
.env

# macOS related
.DS_Store

# oci, terraform related
**/credentials.rc
terraform.tfstate
terraform.tfstate.backup

# End of https://www.gitignore.io/api/java,node,maven,eclipse,intellij+all
jmeter.log
apache-jmeter*
*.jtl
micronaut-webapp/docker-compose.yml
/hello-graal/Hello
/hello-graal/Hello.build_artifacts.txt
native-list-dir/listdir
native-list-dir/listdir.build_artifacts.txt
java-kotlin-aot/helloworld
java-kotlin-aot/helloworld.build_artifacts.txt
shared
micronaut-nativeimage/hello/
micronaut-webapp/loadTests/results-*
mn-python/env/
functionGraphDemo/Rplot001.svg
native-netty-plot/netty-plot.build_artifacts.txt
native-netty-plot/src/main/resources/META-INF/native-image/*
polyglot-javascript-java-r/Rplot001.svg
polyglot-javascript-java-r/package-lock.json
spring-r/Rplot001.svg
scala-examples/scalac-native/project/
scala-examples/scalac-native/scalac.build_artifacts.txt
graalpython-notebook-example/venv/
micronaut-python/venv/
nohup.out
fastR-examples/*.*
*.whl
.vscode
*.log?
venv/
espresso-jshell/espresso-jshell
espresso-jshell/espresso-jshell.build_artifacts.txt
native-list-dir/extlistdir
native-list-dir/extlistdir.build_artifacts.txt
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@ These programs are illustrating diverse capabilities of [GraalVM](http://graalvm

Clone this repository. Every top level folder here contains demo sources and the instructions on how to run that particular code are in its README.md.

In case you wish to run some of the examples (console-based, non-GUI) inside the confinement of a docker container, then please follow then after cloning the repo but before running any of the demos, please do the below:

Build the **GraalVM** demo docker image of choice:
```
$ cd docker-images
$ ./buildDockerImage.sh "java11-21.2.0"
```

Run the GraalVM demo docker container built above:
```
$ ./runDockerImage.sh "java11-21.2.0"
```


Run a docker container with GraalVM runtime in it (from the root directory of the project) for **GUI-based** apps:

```
$ DEMO_TYPE="gui" ./runDockerImage.sh "java11-21.2.0"
```

_(One-off: download and install any **VNCViewer**)_
_(Wait for the container to be ready, then run VNCViewer and then log onto http://127.0.0.1:5900 (type it in, in case copy-paste does not work) via the **VNCViewer** to access the GUI interface. You will get an `xterm` screen, where you can type in your commands just like the docker console or any other CLI prompt.)_

Note: Valid tags to specify as parameters, can be found [here](https://github.com/graalvm/container/pkgs/container/graalvm-ce). A number of free or commercial [VNCViewers](https://duckduckgo.com/?q=vnc+viewer+download&ia=web) can be found online and are fairly easy to use.


Once the docker container is running, go to the folder of the respective demos, and follow the instructions.

## Tested Compatibility

The demos are normal applications and benchmarks written in Java, Kotlin, JavaScript, etc., so they are compatible with any virtual machine capable of running Java, JavaScript and so on.
Expand Down
139 changes: 139 additions & 0 deletions docker-images/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
ARG DOCKER_USER_NAME
ARG SOURCE_DOCKER_HUB
ARG FULL_GRAALVM_VERSION

FROM ${SOURCE_DOCKER_HUB}:${FULL_GRAALVM_VERSION} as graalvm-jdk-image
FROM ${DOCKER_USER_NAME}/micronaut-starter:${FULL_GRAALVM_VERSION} as micronaut-starter-image
FROM ${DOCKER_USER_NAME}/workload-generator as workload-generator

FROM debian:buster
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to use debian here instead of e.g. the official GraalVM Docker image from https://github.com/graalvm/container/pkgs/container/graalvm-ce ?
That might make things easier, because we test on OracleLinux in CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, no we can use GraalVM as the base image, thanks for confirming this saves building time.

The original code evolved such that I swayed away from this approach due to some issues but I can revert to your suggestion.

Copy link
Contributor Author

@neomatrix369 neomatrix369 Oct 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you install packages in the Graalvm docker image, apt or aptitude is not available?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@neomatrix369 neomatrix369 Oct 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

microdfn isn't able to find g++, libc++-dev, libssl-dev, the latter fixed the TruffleRuby and FastR issues we had with galaaz demos

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image I'm building is using an official GraalVM images if you see the buildDockerImage.sh and Dockerfile and Dockerfile-mn in the docker-images/ sub-folder.

In this Dockerfile, it's reusing some files from the offical Docker images, but transplanting on debian:buster.
That's absolutely not guaranteed to work, it feels pretty hacky honestly. For instance the files in the official images might already be tweaked to run on OracleLinux, for instance https://github.com/graalvm/container/blob/326e236ee937de37769e0709505dafdb7a6a9f78/community/Dockerfile.java11#L44-L53.

I'm checking with @ezzarghili, I think there is a way to install rpm's for each component/language, and that should automatically install all required system dependencies. They are currently working on having 21.3 Docker images with those rpm packages.
Maybe we can even have a Docker image with all components pre-installed, that sounds ideal for this use-case, isn't it?

IMHO trying to minimize dependencies below what is marked as requirement for each component is not a good thing and will just into problems, e.g., I think nobody is happy to help you debug if you on purpose skipped some documented dependency.

I don't understand the concern about image size here. It's a repo of demos with all languages, of course the image will be big, and I don't think it's much of an issue.


I understand it's easier for you for now to use debian-based images and you don't want to change everything right now.
But if we get something like Docker images with rpms or already all components we should use that, instead of hardcoding and manually finding system dependencies in yet another place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we get something like Docker images with rpms or already all components we should use that, instead of hardcoding and manually finding system dependencies in yet another place.

I agree with using them - as this would be ideal and makes it consistent. If a standard image/config for Docker or anything of that sort is available, I would just like to use it as it would work out-of-the-box as you mentioned earlier.

I don't fully agree about your comment about "hacky" in this context, I will agree it's less optimum or less efficient, but it's done in the absence of the standard image or the know-how about it.

I will say the same about the docs, they are not necessary if you have config files and single-line commands to create images using those config files (I see you have these in different places in some form or shape). Incorporating existing config or images and building on top of them is more appropriate. That idea is still in the files/scripts in the script, maybe it's not visible, reusing components is definitely the way to go.

What has happened here is actually a bit of reinvention of the wheel, which is debatable if it could have been avoided but now we learning from what's available, happy to adapt them. This will also reduce the calls to various teams for help in case something does not work - I do not wish to do this either, it can hold up the process on this end as well.

After all of this, there is still chances of something not working but then those are much less. Also, peer review helps iron out these glitches, and it's a one-off because when this works it will always work unless the upstream regresses or something specific has been changed downstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can even have a Docker image with all components pre-installed, that sounds ideal for this use-case, isn't it?

This is something I would have been doing in my second refactor round for these scripts, but if this is already in the planning then I can wait and adapt those images and build on top of them - thanks for letting me know I will keep an eye for it

Copy link
Contributor Author

@neomatrix369 neomatrix369 Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand it's easier for you for now to use debian-based images and you don't want to change everything right now.

Only for now, but it's on my mental list to change it. But I'm always happy to change the docker and shell scripts -- if we can reduce all the lines written to a few lines then that's a better solution and reusing existing images could be a way towards that.

Copy link
Contributor Author

@neomatrix369 neomatrix369 Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a repo of demos with all languages, of course the image will be big, and I don't think it's much of an issue.

Thinking of this again, you are right, I'll take that back -- image size should not be an issue, especially to avoid inconsistency and be able to reproduce issues on the same image type. A whole chain of things can happen if images differ in signature, and be hard to trackback or investigate, as the number of moving parts are increasing.


COPY --from=workload-generator /tmp/wrk/wrk /usr/local/bin
RUN echo "Testing 'wrk':"; wrk || true

# Install other smaller utilities needed during building of image in the slim image
RUN echo; echo "--- Installing wget, curl, vim, unzip in the slim image"; echo
RUN apt-get update \
&& apt-get install -yq --no-install-recommends \
wget curl vim unzip gnupg2 \
make gcc g++ libc++-dev \
openssl libssl-dev libcrypto++-dev libz.a \
locales ca-certificates
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*

# https://www.rosehosting.com/blog/configure-system-locale-on-debian-9/
# https://people.debian.org/~schultmc/locales.html <-- simple steps
RUN echo "--- Installing and setting locales"
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US"
RUN locale-gen
RUN echo; echo "LANG=${LANG}"; echo "LANGUAGE=${LANGUAGE}";
RUN echo; echo "List of installed locales:"; locale -a; echo;

# Install gcc and make
RUN echo "gcc version: "; gcc --version
RUN echo "make version: "; make --version

ARG GRAALVM_HOME

# Install and setup GraalVM
COPY --from=graalvm-jdk-image /opt/graalvm-* ${GRAALVM_HOME}

ENV JAVA_HOME=${GRAALVM_HOME}
ENV PATH=${JAVA_HOME}/bin:${PATH}
RUN echo; echo "JAVA_HOME=${JAVA_HOME}"; echo
RUN echo; echo " --- GraalVM version (runtime)"; java -version; echo

# Install some of the needed components using 'gu install'
RUN echo; echo " --- Download & install 'espresso' using gu"; gu install espresso; echo
RUN echo; echo " --- Download & install 'nodejs' using gu"; gu install nodejs; echo
RUN echo; echo " --- Download & install 'python' using gu"; gu install python; echo
RUN echo; echo " --- Download & install 'R' using gu"; gu install R; echo
RUN echo; echo " --- Download & install 'Ruby' using gu"; gu install ruby; echo
neomatrix369 marked this conversation as resolved.
Show resolved Hide resolved
RUN echo; echo " --- Download & install 'native-image' using gu"; gu install native-image; echo

# Rebuild Ruby to make the Ruby openssl C extensions to work with the local system libssl (see https://github.com/oracle/truffleruby/blob/master/doc/user/installing-graalvm.md#installing-ruby-and-other-languages)
RUN echo "Rebuilding Ruby to make the Ruby openssl C extensions to work with the local system libssl"

RUN export RUBY_POST_HOOK_SCRIPT="$(find ${GRAALVM_HOME} -name *post_install_hook.sh*)"; \
chmod +x ${RUBY_POST_HOOK_SCRIPT}; \
bash ${RUBY_POST_HOOK_SCRIPT};
# At the moment this is a simple litmus test to verify that the above step has actually worked!
RUN echo "Installing ruby gems to verify if the above installation and rebuilding processes are working..."
RUN gem install rspec galaaz

RUN echo "gcc version: "; gcc --version
RUN echo "make version: "; make --version

# https://github.com/oracle/truffleruby/blob/master/doc/user/ruby-managers.md#chruby
RUN if [ -e "${GRAALVM_HOME}/jre" ]; then ruby_home=$(${GRAALVM_HOME}/jre/languages/ruby/bin/ruby -e 'print RbConfig::CONFIG["prefix"]'); else ruby_home=$(${GRAALVM_HOME}/languages/ruby/bin/ruby -e 'print RbConfig::CONFIG["prefix"]'); fi


# Install Java 8
COPY --from=java:8u111-jdk /usr/lib/jvm /usr/lib/jvm

ENV JDK8_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"
RUN echo; echo "JDK8_HOME=${JDK8_HOME}"; echo
RUN echo; echo "PATH=${PATH}"; echo
RUN echo " --- Java 8 version:"; ${JDK8_HOME}/bin/java -version; echo

# Install mvn
ARG MAVEN_VERSION
RUN cd /tmp
RUN wget -q -nv https://raw.githubusercontent.com/Drambluker/install-maven/main/install-maven.sh
RUN wget -q -nv "https://www.mirrorservice.org/sites/ftp.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
RUN chmod +x ./install-maven.sh
RUN ./install-maven.sh -f apache-maven-${MAVEN_VERSION}-bin.tar.gz
ENV M2_HOME="/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}/"
ENV PATH=${M2_HOME}/bin:${PATH}
RUN echo " --- Maven version:"; mvn --version; echo

# Install gradle
ARG GRADLE_VERSION
RUN cd /tmp/; wget -q -nv https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip
RUN cd /tmp/; unzip gradle-${GRADLE_VERSION}-bin.zip && mv gradle-${GRADLE_VERSION} /
ENV GRADLE_HOME="/gradle-${GRADLE_VERSION}"
ENV PATH=${GRADLE_HOME}/bin:${PATH}
RUN echo " --- Gradle version:"; gradle --version; echo

# Install jmeter
RUN cd /tmp/; wget -q -nv "https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.4.1.zip"
RUN unzip /tmp/apache-jmeter-5.4.1.zip
ENV JMETER_HOME="${WORKDIR}/apache-jmeter-5.4.1"
ENV PATH=${JMETER_HOME}/bin:${PATH}
RUN echo " --- Jmeter version:"; jmeter --version; echo

# Install scala and sbt
ARG SBT_VERSION
RUN echo; echo "--- Installing scala and sbt in the slim image"; echo
# See https://www.scala-sbt.org/download.html
RUN cd /tmp/; wget -q -nv https://github.com/sbt/sbt/releases/download/v${SBT_VERSION}/sbt-${SBT_VERSION}.zip
RUN cd /tmp/; unzip sbt-${SBT_VERSION}.zip; mv sbt /usr/share; ln -s /usr/share/sbt/bin/sbt /usr/bin/sbt
RUN echo "sbt version:"; sbt --version | grep "sbt script version"; echo

ARG SCALA_VERSION
# See https://www.scala-lang.org/download/
RUN cd /tmp/; wget -q -nv https://github.com/lampepfl/dotty/releases/download/${SCALA_VERSION}/scala3-${SCALA_VERSION}.zip
RUN cd /tmp/; unzip scala3-${SCALA_VERSION}.zip; mv scala3-${SCALA_VERSION} /usr/share/scala;
RUN ln -s /usr/share/scala /usr/share/scala-${SCALA_VERSION}; ln -s /usr/share/scala/bin/scala /usr/bin/scala
RUN echo "scala version:"; scala -version; echo

# this location maps to the specific vesion of Scala for e.g. scala-2.12 or 3.0.2
ENV SCALA_HOME="/usr/share/scala"
RUN echo; echo "SCALA_HOME=${SCALA_HOME}"; echo

COPY --from=micronaut-starter-image /root/.micronaut/micronaut-cli /root/.micronaut/micronaut-cli
ENV MICRONAUT_HOME="/root/.micronaut/micronaut-cli"
ENV PATH=${MICRONAUT_HOME}/bin:${PATH}
RUN echo; echo " --- Micronaut version"; mn --version; echo

# Some demo apps require this env variable set
ENV GRAALVM_HOME=${GRAALVM_HOME}
RUN echo; echo "GRAALVM_HOME=${GRAALVM_HOME}"; echo

LABEL maintainer="GraalVM team"
LABEL example_git_repo="https://github.com/graalvm/graalvm-demos"
LABEL graalvm_version=${FULL_GRAALVM_VERSION}
LABEL version=${FULL_GRAALVM_VERSION}
39 changes: 39 additions & 0 deletions docker-images/Dockerfile-gui
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# https://www.cloudsavvyit.com/10520/how-to-run-gui-applications-in-a-docker-container/ - latter part of the blog

ARG DOCKER_USER_NAME
ARG FULL_GRAALVM_VERSION
FROM ${DOCKER_USER_NAME}/graalvm-demos:${FULL_GRAALVM_VERSION}

# Install xterm in order to be able to access it when running GUI apps
RUN apt-get update \
&& apt-get install -yq --no-install-recommends \
x11vnc xvfb xterm \
xfonts-75dpi xfonts-100dpi xfonts-base \
libfontconfig1 libxrender1 libxtst6 \
libgomp1 zlib1g liblzma5 libc6 \
libbz2-1.0 bzip2 patch \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/*

RUN echo "gcc version: "; gcc --version
RUN echo "make version: "; make --version

# https://askubuntu.com/questions/161652/how-to-change-the-default-font-size-of-xterm#161704
RUN echo "exec xterm -maximized -fa 'Monospace' -fs 18" > \
~/.xinitrc && chmod +x ~/.xinitrc
RUN echo ""; echo "Contents of ~/.xinitrc"; echo ""; cat ~/.xinitrc; echo "";
RUN echo "xterm*font: *-Monospace-*-*-*-18-*" > ~/.Xresources
RUN echo ""; echo "Contents of ~/.Xresources"; echo ""; cat ~/.Xresources; echo "";

# Adding environment variable to support older demos that rely on the GRAALVM_DIR env variable
ENV GRAALVM_DIR="${JAVA_HOME}"
RUN echo "GRAALVM_DIR=${GRAALVM_DIR}"
RUN echo "GRAALVM_HOME=${GRAALVM_HOME}"

LABEL maintainer="GraalVM team"
LABEL example_git_repo="https://github.com/graalvm/graalvm-demos"
LABEL graalvm_version=${FULL_GRAALVM_VERSION}
LABEL version=${FULL_GRAALVM_VERSION}

# manual: https://linux.die.net/man/1/x11vnc
CMD ["x11vnc", "-create", "-forever", "-geometry", "1024x768"]
35 changes: 35 additions & 0 deletions docker-images/Dockerfile-mn
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG SOURCE_DOCKER_HUB
ARG FULL_GRAALVM_VERSION
FROM ${SOURCE_DOCKER_HUB}:${FULL_GRAALVM_VERSION} as graalvm-jdk-image

FROM buildpack-deps:stretch-scm

# Install smaller utilities needed during building of image in the slim image
RUN echo; echo "--- Installing wget, curl, vim, unzip in the slim image"; echo
RUN apt-get update && \
apt-get install -yq --no-install-recommends unzip git

ARG GRAALVM_HOME

# Install and setup GraalVM
COPY --from=graalvm-jdk-image /opt/graalvm-* ${GRAALVM_HOME}

ENV JAVA_HOME=${GRAALVM_HOME}
ENV PATH=${GRAALVM_HOME}/bin:${PATH}
RUN echo; echo "JAVA_HOME=${JAVA_HOME}"; echo
RUN echo; echo " --- GraalVM version (runtime)"; java -version; echo

# Build and Install micronaut
RUN cd /tmp; git clone https://github.com/micronaut-projects/micronaut-starter.git
RUN cd /tmp/micronaut-starter; ./gradlew micronaut-cli:assembleDist
RUN mkdir -p ~/.micronaut; unzip /tmp/micronaut-starter/starter-cli/build/distributions/micronaut-cli-*.zip -d ~/.micronaut
ENV MICRONAUT_HOME="/root/.micronaut/micronaut-cli"
RUN OLD_NAME=$(ls ~/.micronaut); mv ~/.micronaut/${OLD_NAME} ${MICRONAUT_HOME}
RUN echo "MICRONAUT_HOME=${MICRONAUT_HOME}"; \
ls -lash ${MICRONAUT_HOME}/bin; \
echo; echo "micronaut version:"; ${MICRONAUT_HOME}/bin/mn --version; echo

LABEL maintainer="GraalVM team"
LABEL git_repo="https://github.com/micronaut-projects/micronaut-starter.git"
LABEL graalvm_version=${FULL_GRAALVM_VERSION}
LABEL version=${FULL_GRAALVM_VERSION}
15 changes: 15 additions & 0 deletions docker-images/Dockerfile-wrk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM buildpack-deps:stretch-scm

# Build and Install wrk in the slim image, see https://github-wiki-see.page/m/giltene/wrk2/wiki/Installing-wrk2-on-Linux
RUN echo; echo "--- Installing wrk: workload generator (multiple threads)"; echo
RUN apt-get update
RUN apt-get install -yq --no-install-recommends build-essential libssl-dev git unzip

RUN cd /tmp; git clone https://github.com/wg/wrk.git
RUN cd /tmp/wrk; make
RUN chmod +x /tmp/wrk/wrk; cp /tmp/wrk/wrk /usr/local/bin
RUN echo "Testing 'wrk':"; wrk || true

LABEL maintainer="GraalVM team"
LABEL git_repo="https://github.com/wg/wrk.git"
LABEL version=0.1
Loading