Skip to content

feat(adapters): Ruby build recipe — stock Rails apps cannot bundle install today - #469

Merged
Hydralerne merged 3 commits into
oblien:feat/bugfix-batch-2026-09-16from
a-abdellatif98:feat/rails-docker-recipe
Sep 16, 2026
Merged

Hydralerne merged 3 commits into
oblien:feat/bugfix-batch-2026-09-16from
a-abdellatif98:feat/rails-docker-recipe

Conversation

@a-abdellatif98

@a-abdellatif98 a-abdellatif98 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Rails builds using the current Ruby images can fail on native gems because the slim image has no compiler, or fail at runtime because Bundler settings and shared libraries do not match the build. This adapts the contributor’s Ruby recipe to the current build planner and targets the bug integration branch for #892.

The builder installs native build dependencies; the runtime keeps the linked libraries and runs as an unprivileged user. Debian and Alpine images use their own package manager and account commands. Both stages share the Bundler production settings and reuse the existing workspace, build environment and runtime copy helpers. Rails storage is writable and persists through the existing volume mechanism from #468. This addresses the Ruby deployment failures discussed in #231; the broader process-model request remains open.

Validation:

  • 63 adapter recipe/entrypoint tests pass, including 17 Ruby cases, plus adapter TypeScript.
  • Real Debian and Alpine Docker builds compile and load a local native gem. The main-generated images fail the same native-gem build.
  • Both resulting images run as UID 1000 without the compiler toolchain and retain a storage marker across replacement containers using the same named volume.

The original author’s commit is retained; current-architecture adaptations are merged into this PR before integration into #892.

ruby:*-slim installs gcc/make to compile Ruby and then purges them, so
bundle install could not build pg or bootsnap and a stock Rails app failed
on its first deploy. Splits a builder stage carrying the toolchain from a
runtime stage carrying only the shared libs the gems link against.

Also excludes dev/test gems, copies the resolved bundle forward instead of
re-installing, sets a production RAILS_ENV -- development Rails rejects the
deployed hostname via config.hosts -- and drops root.

Dispatch is not gated on needsMultiStage the way the PHP branch is: Ruby
declares one image for both stages, so that gate would skip the recipe.
@Hydralerne
Hydralerne changed the base branch from main to feat/bugfix-batch-2026-09-16 September 16, 2026 05:04
@Hydralerne
Hydralerne merged commit 9ede776 into oblien:feat/bugfix-batch-2026-09-16 Sep 16, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants