Bundle install without some source

34 views
Skip to first unread message

Marko Bogdanović

unread,
Feb 19, 2018, 8:37:20 PM2/19/18
to ruby-bundler
Hi,

I am wondering if it's possible to run something like this:

bundle install --without-source gemfury


In some cases I don't want to install gems from my private gemfury. At the moment I found the best way to do so is with groups, but I wonder if the same can be done only by grouping gems by sources?

More specificaly on why I need this:
I want to build a docker image to which I pass gemfury credential by build argument, but that breaks layer caching with docker because everytime docker assumes it is the different gemfury cred passed via build arg.

So I want to end up with the following setup to optimize image building time:

ADD Gemfile .
ADD Gemfile.lock .
RUN bundle install --without-source https://gem.fury.io/my --jobs 4

# ↓ The following layer would be built every time

ARG GEMFURY_PASSWORD
RUN bundle config https://gem.fury.io/my $GEMFURY_PASSWORD
RUN bundle install --only-source https://gem.fury.io/my --jobs 4
RUN bundle check


Thanks,

Marko
Reply all
Reply to author
Forward
0 new messages