rubocop / circleci-ruby-snapshot-image

Builds a Ruby nightly image and publishes it to Docker Hub
3 stars 3 forks source link

Use BUNDLE_PATH__SYSTEM instead of BUNDLE_PATH=GEM_HOME #10

Closed pocke closed 5 years ago

pocke commented 5 years ago

It will fix rubocop-hq/rubocop#7124

See https://github.com/bundler/bundler/issues/7197 for the problem and solution.

It works on my local machine.

docker build -f Dockerfile.ruby -t rubocophq/ruby-snapshot:latest .
docker run --rm -it rubocophq/ruby-snapshot:latest bash

# in docker
git clone https://github.com/rubocop-hq/rubocop
cd rubocop
bundle install
ruby -I lib -r rubocop -e 'exit 0'
echo $? # => 0

And bundle exec rake also works.

Thanks, @deivid-rodriguez!

koic commented 5 years ago

This looks good to me. @bquorning Would you please review this PR?

bquorning commented 5 years ago

Thanks for the PR – I’ll read the two issues and this PR through a little later today, or tomorrow. I hope that’s an ok timeline for you.

bquorning commented 5 years ago

This change has now also been applied to docker-library/ruby in https://github.com/docker-library/ruby/pull/285. I have reverted the change to the Ruby script in d73ad2c7de49a0864d07882dc77b3fe170e88601.

gleuch commented 5 years ago

For anyone setting a pathname or in general experiencing build issues as a result of this change, adding the following into Dockerfile before bundle install helped fix our breaking builds:

ENV BUNDLE_PATH__SYSTEM="false"
RUN bundle config --global disable_shared_gems true
bquorning commented 5 years ago

Following https://github.com/docker-library/ruby/pull/289, I reverted the change once again: c087db4502d8cc0e98ad755fe55ba2aed5882e1b