Bundler fails inside Docker Container
Hi we created a droplet on DigitalOcean with Docker installed.
We added a new user and logged in as the user and we tried building a Docker image with a Ruby on Rails app in it.
But when it comes to the bundle install part it fails with the message:
"bundler http error: bundler could not fetch specs from 'http://rubygems.org'".
Changing source of Gemfile to https://rubygems.org also gives same result.
I am able to do this successfully from outside the container.
Here is my Dockerfile:
FROM phusion/passenger-ruby21 MAINTAINER Steve Robinson "firstname.lastname@example.org" ENV HOME /root CMD ["/sbin/my_init"] RUN rm -f /etc/service/nginx/down RUN rm /etc/nginx/sites-enabled/default ADD ./config/nginx-docker-test.conf /etc/nginx/sites-enabled/docker-test.conf RUN mkdir /home/app/docker-test WORKDIR /tmp ADD Gemfile /tmp/ ADD Gemfile.lock /tmp/ RUN bundle install ADD . /home/app/docker-test RUN chown -R app:app /home/app/docker-test WORKDIR /home/app/docker-test RUN rake assets:precompile RAILS_ENV=production RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Btw this is the blog that I have been following :) https://intercityup.com/blog/how-i-build-a-docker-image-for-my-rails-app/