title: How can I link files in Dockerfile?
body: <p>I'm trying to create a Dockerfile that will deploy rails app but my problem is ruby wont install if I use a docker file. it says /dev/fd is missing. On a normal machine all I have to do is type in the command <code>ln -sf /proc/self/fd /dev/fd</code> and all is fixed. However when I put that command in my Dockerfile it doesn't link to /dev/fd. Here is my Dockerfile:</p>
  
  <pre><code># Select ubuntu as the base image
  FROM ubuntu
  
  # Install nginx, nodejs and curl
  RUN apt-get update -q
  RUN apt-get install -qy nginx
  RUN apt-get install -qy curl
  RUN apt-get install -qy nodejs
  RUN echo "daemon off;" &gt;&gt; /etc/nginx/nginx.conf
  
  # Install rvm, ruby, bundler
  RUN curl -sSL https://get.rvm.io | bash -s stable
  RUN ln -sf /proc/self/fd /dev/fd
  RUN echo "source /usr/local/rvm/scripts/rvm" &gt;&gt; /etc/bash.bashrc
  RUN /bin/bash -l -c "rvm requirements"
  RUN /bin/bash -l -c "rvm install 2.1.2"
  </code></pre>
  
  <p>I would get an error something like /dev/fd: missing file or folder or something like that. If I omit the last line, everything successfully builds but when I log in to the image I just built and cd into /dev/fd it says no such file or directory. How come it successfully builds but does not link the files I tell it to?</p>