Kar*_*ikJ 7 centos ulimit docker linux-containers
我正在尝试为Couchbase创建一个docker镜像,我在CentOS镜像上的dockerfile出现以下错误.
# expose default port
EXPOSE 8091
ENV PATH $PATH:/opt/couchbase/bin
RUN cd /var/tmp &&\
wget http://packages.couchbase.com/releases/2.5.0/couchbase-server-enterprise_2.5.0_x86_64.rpm &&\
rpm -ivh couchbase-server-enterprise_2.5.0_x86_64.rpm &&\
chkconfig couchbase-server on &&\
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"]
Run Code Online (Sandbox Code Playgroud)
在构建它时,我收到以下错误..
ulimit: open files: cannot modify limit: Operation not permitted
ulimit: max locked memory: cannot modify limit: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
我在论坛中看到我们可以在docker.conf文件中设置这些值.但我尝试创建这个文件/etc/init/docker.conf并将以下行放在该文件中 -
限制memlock无限制限制nofile 262144
但我仍然得到同样的错误.
如果我在CentOS VM上手动执行相同的步骤,它可以工作.所以我想我需要在Docker CentOS图像上设置一些东西.
通过使用以下命令在Docker主机上设置ulimit解决了该问题:
ulimit -l unlimited
ulimit -n 10240
ulimit -c unlimited
Run Code Online (Sandbox Code Playgroud)
然后重新启动CentOS上的Docker服务.这解决了问题,因为主机的这些值将由容器继承.
归档时间: |
|
查看次数: |
25091 次 |
最近记录: |