title: How to run a docker container for ruby on rails without root user?
body: <p>I'm trying to run a RoR project without root user on docker. I'm using the official ruby image and when I execute <code>bundle install</code> with a non root user everything goes okay, but when I run <code>rails s -b '0.0.0.0'</code> or <code>bundle exec rails s -b '0.0.0.0'</code> I get this error:</p>
  
  <blockquote>
    <p>/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/compile_cache/iseq.rb:37:in `fetch': Permission denied - bs_fetch:atomic_write_cache_file:open (Errno::EACCES)</p>
  </blockquote>
  
  <p>Here is my Dockerfile:</p>
  
  <pre><code>FROM ruby:2.6.3
  
  COPY controleGarrafao/ /home/docker/controleGarrafao
  
  RUN apt-get update -qq &amp;&amp; apt-get install sudo
  WORKDIR /home/docker/controleGarrafao
  RUN chmod +x /usr/bin/docker_entrypoint.sh
  RUN chmod 777 /usr/local/bin/bundle
  
  RUN useradd -m docker &amp;&amp; echo "docker:docker" | \
      chpasswd
  
  RUN echo "docker ALL=(ALL:ALL) NOPASSWD: ALL" | \ 
      tee -a /etc/sudoers
  
  RUN chmod 777 /home/docker
  
  USER docker
  RUN bundle install
  EXPOSE 3000
  </code></pre>
  
  <p>Can someone help me with this?</p>