GraalVM Community Images #

Nowadays, containers are perfectly suited for microservices approach to improve software development and business agility. Learn here how to start using GraalVM Community images for Docker containers.

GraalVM Community container images are available for download from GitHub Container Registry.

  1. Having the Docker daemon running, pull the image from GitHub with docker pull:
    docker pull
  2. Alternatively, use as the base image in Dockerfile:

There are different GraalVM Community container images provided depending on the architecture and the Java version. GraalVM binaries are built for Linux, macOS, and Windows platforms on x86 64-bit systems, and for Linux on ARM 64-bit systems. The images are multi-arch (aarch64 or amd64 will be pulled depending on Docker host architecture), and named per a platform-jdk-version naming scheme, for example, A complete list can be found on the All versions page.

The images are based on Oracle Linux and has GraalVM Community downloaded, unzipped and made available. It means that Java, JavaScript, Node.js and the LLVM runtime are available out of the box.

You can start a container and enter the bash session with the following run command:

docker run -it bash

Check that java, js and other commands work as expected.

→ docker run -it bash
bash-4.4# java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-b03)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.0 (build 25.282-b03-jvmci-21.0-b04, mixed mode)
bash-4.4# node
Welcome to Node.js v12.20.1
Type ".help" for more information.
> 1 + 1
> process.exit()
bash-4.4# lli --version
LLVM 10.0.0 (GraalVM CE Native 21.0.0)

Please note that the image contains only the components immediately available in the GraalVM Community distribution. However, the GraalVM Updater utility is on the PATH and you can install the support for additional languages like Ruby, R, Python or WebAssembly at will. For example, the following command installs the Ruby support (the output below is truncated for brevity):

docker run -it bash
bash-4.4# gu install ruby
Downloading: Component catalog
Processing component archive: Component ruby
Downloading: Component ruby
[######              ]

If you want to mount a directory from the host system to have it locally available in the container, use Docker volumes.

Here is a sample command that maps the /absolute/path/to/directory/no/trailing/slash directory from the host system to the /path/inside/container inside the container.

docker run -it -v /absolute/path/to/directory/no/trailing/slash:/path/inside/container bash

If you want to create Docker images that contain GraalVM with Ruby, R, or Python, you can use a Dockerfile like the example below, which uses as the base image, installs the Ruby support using the gu utility, then creates and runs a sample Ruby program.

RUN gu install ruby
WORKDIR /workdir
RUN echo 'puts "Hello from Ruby!\nVersion: #{RUBY_DESCRIPTION}"' > app.rb
CMD ruby app.rb

If you put the above snippet in a Dockerfile in the current directory, you can build and run it with the following commands:

docker build -t ruby-demo .
docker run -it --rm ruby-demo
Hello from Ruby!
Version: truffleruby 21.0.0, like ruby 2.7.2, GraalVM CE Native [x86_64-darwin]