title: How to create a docker image with passenger?
body: <p>I'm trying to create a docker image with a rails app and passenger.
  I have read this article : <a href="https://intercityup.com/blog/how-i-build-a-docker-image-for-my-rails-app.html" rel="nofollow">https://intercityup.com/blog/how-i-build-a-docker-image-for-my-rails-app.html</a></p>
  
  <p>It works good, gems are well installed, but when I call the app, I have this error : </p>
  
  <blockquote>
    <p>Message from application: libruby.so.2.1: cannot open shared object file: No such file or directory - /home/app/webapp/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/pg-0.18.3/pg_ext.so (LoadError)</p>
  </blockquote>
  
  <p>And when I'm connecting to the image, the file /home/app/webapp/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/pg-0.18.3/pg_ext.so really exists.</p>
  
  <p>So I don't understand what happened.</p>
  
  <p>My docker file :</p>
  
  <pre><code>FROM phusion/passenger-ruby21:0.9.12
  MAINTAINER Eric L'Hostis "eric.lhostis@gmail.com"
  
  # Set correct environment variables.
  ENV HOME /root
  
  # Use baseimage-docker's init system.
  CMD ["/sbin/my_init"]
  
  # Conf Nginx / Passenger
  RUN rm -f /etc/service/nginx/down
  RUN rm /etc/nginx/sites-enabled/default
  ADD nginx.conf /etc/nginx/sites-enabled/webapp.conf
  
  # Prepare folders
  RUN mkdir /home/app/webapp
  WORKDIR /tmp
  ADD Gemfile /tmp/
  ADD Gemfile.lock /tmp/
  RUN bundle install
  
  # Add the rails app
  ADD . /home/app/webapp
  </code></pre>
  
  <p>And to create/run the image.</p>
  
  <pre><code>docker build -t myimage .
  docker run -d -p 80:80 myimage
  </code></pre>
  
  <p>I have already trying to install these libs : libpq-dev, nodejs, build-essential, postgresql
  without success :(</p>