Skip to content

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

@mrj

Description

@mrj

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions