truffleruby-community is the GraalVM high-performance implementation of the Ruby programming language.
See https://github.com/graalvm/container/pkgs/container/truffleruby-community
-
Oracle Linux 9:
latest
/VERSION
. -
Oracle Linux 9 no toolchain:
slim
/slim-VERSION
. -
Oracle Linux 8:
ol8
/ol8-VERSION
. -
Oracle Linux 8 no toolchain:
ol8-slim
/ol8-slim-VERSION
. -
Debian 10:
debian
/debian-VERSION
.
The no toolchain
variants mean the GraalVM LLVM toolchain and its dependencies needed to install C extensions are not included to save space.
It is still possible to use gems with C extensions, but the gems must be installed before for instance using a multi-stage build, see Multi-stage build for the no-toolchain images below.
The images are intended for use in the FROM field of a downstream Dockerfile.
For example, specify FROM ghcr.io/graalvm/truffleruby-community:latest
or another tag.
Here is an example Dockerfile
:
FROM ghcr.io/graalvm/truffleruby-community:latest
# Copy app, Gemfile and Gemfile.lock
COPY . /app
WORKDIR /app
RUN bundle config --local path vendor/bundle
RUN bundle install
RUN bundle exec ruby app.rb
# Builder image with the toolchain to install gems
FROM ghcr.io/graalvm/truffleruby-community:latest AS builder
# Copy app, Gemfile and Gemfile.lock
COPY . /app
WORKDIR /app
RUN bundle config --local path vendor/bundle
RUN bundle install
# Resulting image without the toolchain and including the gems
FROM ghcr.io/graalvm/truffleruby-community:ol9-slim
COPY --from=builder /app /app
WORKDIR /app
RUN bundle exec ruby app.rb
Use microdnf install some-package
.
Use apt update
and apt install some-package
.
For manually building a truffleruby-community image from one of these Dockerfiles, use:
docker build --build-arg GRAALVM_VERSION=<GraalVM Version> -t ghcr.io/graalvm/truffleruby-community:TAG -f Dockerfile .