Reputation: 1729
I use Docker for Windows
which I use to run a Image for a Rails(v5) App.
When I do docker-compose build
I get this error. I don't known where to look to debug and/or resolve this.
Here is my Dockerfile
:
FROM ruby:2.3.3-slim
RUN apt-get update && apt-get install -y build-essential
RUN apt-get install -y libmysqlclient-dev
RUN apt-get install -y mysql-client
RUN apt-get install -y libmagickwand-dev imagemagick
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y git
#RUN npm install -g phantomjs
RUN gem update --system
RUN mkdir -p /MyImage
WORKDIR /MyImage
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN gem install bundler
RUN bundle install
COPY package.json package.json
RUN npm update
RUN npm install
COPY . /MyImage
CMD [ "foreman", "start" ]
Here is a log if my error:
Step 15/20 : RUN bundle install
---> Running in 4bf360b89cb7
The git source `git://github.com/acrogenesis/owlcarousel-rails.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/sinatra/sinatra.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Fetching source index from https://rubygems.org/
Fetching source index from https://rails-assets.org/
Fetching git://github.com/sinatra/sinatra.git
Fetching git://github.com/acrogenesis/owlcarousel-rails.git
Fetching gem metadata from https://rails-assets.org/..
Fetching rake 12.1.0
Installing rake 12.1.0
Errno::ENOENT: No such file or directory @ rb_sysopen -
/usr/local/lib/ruby/site_ruby/2.3.0/bundler/templates/Executable
An error occurred while installing rake (12.1.0), and Bundler cannot continue.
Make sure that `gem install rake -v '12.1.0'` succeeds before bundling.
In Gemfile:
autonumeric-rails was resolved to 2.0.0.1, which depends on
jquery-rails was resolved to 4.3.1, which depends on
railties was resolved to 5.0.6, which depends on
rake
ERROR: Service 'MyImage' failed to build: The command '/bin/sh -c bundle install' returned a non-zero code: 5
But when I do gem install rake -v '12.1.0'
directly into the shell of my container, everything install just fine.
Upvotes: 0
Views: 1314
Reputation: 2163
Just try to install rake by yourself as described in the error message:
gem install rake -v '12.1.0'
To debug:
Comment out all lines in your Dockerfile
starting from RUN bundle install
and to end;
Then run docker build -t test:0.0 .
;
To start interactive session: docker run -it test:0.0 /bin/bash
;
Try to execute gem install rake -v '12.1.0'
manually...
Upvotes: 2