ruby / ruby/rubygems

In a Docker container, gems at a path can't be installed

Open
#8,916 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bundler status: feedback required
Dominant language
Ruby
Stars
4k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
81

Description

When running bundle install in a Docker container, only Gemfile entries at a URL can be installed — Gems at a local path can't unless pre-copied, forcing a (possibly-premature) remote commit.

This is expected, because even if the container has been given access to the local file system, bundle is unaware of it.

One solution would be to add a --home-path option to bundle install, which provides the path into a mounted file system equivalent to the non-container Gemfile location, to which Gem paths are relative.

For example, if an entry in the Gemfile in the myapp directory is

gem 'xyz', path: '../xyz'

Then by mapping this myapp parent directory as the root of a file system mapped into the container at path /local

bundle install --home-path=/local/myapp

can now install paths like the above, now relative to the home-path setting.

Absolute paths would require mounting the whole file system. Interpreting ~ home directory path leaders would be helpful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the bundle install option handling and local path dependency resolution; no source files or tests are named in the issue. Use the Docker and Gemfile examples to define how --home-path should resolve relative and ~ paths, then add coverage showing that mounted local gems install without being pre-copied.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ruby
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.