簡體   English   中英

docker entrypoint.sh沒有root權限

[英]docker entrypoint.sh not have the permission of root

Dockerfile

FROM ubuntu:18.04

ADD entrypoint.sh /usr/local/bin/
RUN chown root:root /usr/local/bin/entrypoint.sh
RUN chmod 4755 /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]

入口點.sh

#!/usr/bin/env bash

ulimit -n 5000000
docker build -t test .
docker run -it --rm --name testE test bash  

結果:/usr/local/bin/entrypoint.sh:第3行:ulimit:打開文件:無法修改限制:不允許操作

如何解決問題?

你可以在參數中做到這一點

docker run -it --ulimit nofile=1024:1024  --rm --name testE test bash

點擊set-ulimits-in-container

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM