title: Docker error while creating couchbase - ulimit: open files: cannot modify limit: Operation not permitted
body: <p>I am trying to create a docker image for Couchbase and i get the following error with the dockerfile on CentOS image.</p>
  
  <pre><code># expose default port
  EXPOSE 8091
  
  ENV PATH $PATH:/opt/couchbase/bin
  
  RUN cd /var/tmp &amp;&amp;\
      wget http://packages.couchbase.com/releases/2.5.0/couchbase-server-enterprise_2.5.0_x86_64.rpm &amp;&amp;\
      rpm -ivh couchbase-server-enterprise_2.5.0_x86_64.rpm &amp;&amp;\
      chkconfig couchbase-server on &amp;&amp;\
      service couchbase-server start
  
  #add start script to the container
  ADD start /start
  
  #make the script executable
  RUN chmod 0755 /start
  
  EXPOSE 11211 11210 11209 4369 8092 18091 18092 11214 11215
  
  #start mysql service and launch the command console
  CMD ["/start"]
  </code></pre>
  
  <p>When building it, i am getting the following error ..</p>
  
  <pre><code>ulimit: open files: cannot modify limit: Operation not permitted
  ulimit: max locked memory: cannot modify limit: Operation not permitted
  </code></pre>
  
  <p>I saw in a forum that we can set these values in docker.conf files. But i tried creating this file /etc/init/docker.conf and put the following lines in that file-</p>
  
  <p>limit memlock unlimited unlimited
  limit nofile 262144</p>
  
  <p>but still i get the same error.</p>
  
  <p>If i follow the same steps manually on CentOS VM, it works. So i guess i need to set something on Docker CentOS image.</p>