-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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.