Jets Project Node Version

Jets auto-detects your project’s Ruby version and uses that version. The version is used for the base Docker Image to pull from. Example.

FROM ruby:3.2.3-slim as base

For package type image, Jets uses is the official DockerHub Ruby slim variant as the base FROM image.

For package type zip, the default FROM uses the AWS Lambda official public.ecr.aws/lambda/ruby image.

Precedence

The auto-detection precedence works in this order:

  1. config
  2. Gemfile
  3. .tool-versions or .ruby-version
  4. default

It’s recommended to use either #2 Gemfile or #3 .tool-versions or .ruby-version.

config

You can configure the Ruby version to use with a config. It takes the highest precedence.

config/jets/deploy.rb

Jets.deploy.configure do
  config.dockerfile.image_package.from_base.ruby_version = "3.2.3"
  # config.dockerfile.image_package.from_base.image_variant = "slim"
end

Important: The config is only recommended if you do not have .ruby-version or a ruby declaration in your Gemfile. If you have both, the remote build process may fail since the Docker base image will use the config, but the project may use another version based on .ruby-version or Gemfile. If they do not match, then the build process will fail.

Gemfile

Jets will evaluate the Gemfile and use the Ruby version if there’s a specified ruby version.

Gemfile

ruby "3.2.3"

.tool-versions or .ruby-version

If your project has a .tool-versions (asdf) or .ruby-version, Jets will use that as the Docker ruby base image. If both .tool-versions and .ruby-version exist, the .tool-versions takes higher precedence.

default

The Jets default Ruby version is 3.2.3. This may change in the future.

Ruby Variants

If you do not want to use the Ruby slim variant, you can set it to nil, and Jets will use the full Docker ruby image as the base.

config/jets/deploy.rb

Jets.deploy.configure do
  config.dockerfile.image_package.from_base.image_variant = nil
end

Reference

The table below covers each setting. Each option is configured with config.OPTION. The config. portion is not shown for conciseness. IE: logger.level vs config.logger.level.

Name Default Description
dockerfile.apt.packages.all_stages [] Additional apt packages to install for all Docker stages.
dockerfile.apt.packages.build_stage [] Additional apt packages to install during the build Docker stage.
dockerfile.apt.packages.deployment_stage [] Additional apt packages to install during the deployment Docker stage.
dockerfile.auto_packages true Jets auto-detects required packages based on gems and automatically adds them.
dockerfile.copy_for_bundle nil List of folders to copy before the first bundle install. String or Array of Strings. This can be useful for copying files that are needed for the bundle install. IE: An engines folder with a Gemfile using path: engines/engine_name.
dockerfile.image_package.from_base.docker_image nil Full image name, IE: ruby:3.2.3-slim Overrides other settings.
dockerfile.image_package.from_base.image_name “ruby” Base image name without tag.
dockerfile.image_package.from_base.image_tag nil Auto-detected by default. IE: 3.2.3
dockerfile.image_package.from_base.image_variant “slim” Image variant.
dockerfile.image_package.from_base.ruby_version nil Auto-detected by default. IE: 3.2.3
dockerfile.yum.packages.all_stages [] Additional yum packages to install for all Docker stages.
dockerfile.yum.packages.build_stage [] Additional yum packages to install during the build Docker stage.
dockerfile.yum.packages.deployment_stage [] Additional yum packages to install during the deployment Docker stage
dockerfile.zip_package.from_base.docker_image nil Full image name, IE: public.ecr.aws/lambda/ruby:3.2.3 Overrides other settings.
dockerfile.zip_package.from_base.image_name “public.ecr.aws/lambda/ruby” Base image name without tag.
dockerfile.zip_package.from_base.image_tag nil Auto-detected by default. IE: 3.2.3
dockerfile.zip_package.from_base.image_variant nil IE: “slim”. The AWS Lambda Image do not use variants.
dockerfile.zip_package.from_base.ruby_version nil Auto-detected by default. IE: 3.2.3

See Full Config Reference