Skip to content

when run as non-root, bundle install fails #66

@johnl

Description

@johnl

If I run this container image with "--user nobody" then bundler fails to work by default:

docker run -t -i --user nobody ruby:2.2 bash
nobody@bbc3bf13161b:/$ cd /tmp/
nobody@bbc3bf13161b:/tmp$ cat > Gemfile
source "https://rubygems.org"
gem "json"
nobody@bbc3bf13161b:/tmp$ bundle install --path .
There was an error while trying to write to `/usr/local/bundle/config`. It is likely that you need to grant write permissions for that path.

nobody@bbc3bf13161b:/tmp$ BUNDLE_APP_CONFIG=. bundle install --path .
Fetching gem metadata from https://rubygems.org/..
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Installing json 1.8.3 with native extensions
Using bundler 1.11.2
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ..

This is because bundler tries to create a /usr/local/bundle/config if it doesn't exist, but it doesn't have write permissions to /usr/local/bundle

I'm not sure of the right fix for this. Creating that config file and making it world writeable would work. Configuring bundler to use a config on /tmp would also work - unsure how best to do that right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions