title: How to add self gem files to Dockerfile if use official docker rails image?
body: <p>The official rails image on docker hub:</p>
  
  <p><a href="https://hub.docker.com/_/rails/" rel="nofollow">https://hub.docker.com/_/rails/</a></p>
  
  <p>I create a Dockerfile like:</p>
  
  <pre><code>FROM rails:onbuild
  
  ENV RAILS_ENV=production
  
  ADD vendor/gems/my_gem /usr/src/app/vendor/gems/my_gem
  
  CMD ["sh", "/usr/src/app/init.sh"]
  </code></pre>
  
  <p>My init.sh</p>
  
  <pre><code>#!/bin/bash
  bundle exec rake db:create db:migrate
  bundle exec rails server -b 0.0.0.0
  </code></pre>
  
  <p>My Gemfile</p>
  
  <pre><code>...
  gem 'my_gem', path: './vendor/gems/my_gem'
  ...
  </code></pre>
  
  <p>When I build my docker image:</p>
  
  <pre><code>docker build -t myapp .
  </code></pre>
  
  <p>It said:</p>
  
  <pre><code>...
  The path `/usr/src/app/vendor/gems/my_gem` does not exist.
  The command '/bin/sh -c bundle install' returned a non-zero code: 13
  </code></pre>
  
  <p>The default path is <code>/usr/src/app</code>. How to add special files there?</p>