Google云(GKE)Kubernetes Docker容器中的文件权限错误
我尝试在我的Docker容器中运行初始化脚本,该容器使用Google Cloud Container Engine(GKE)上的Kubernetes kubectl命令进行部署。
该脚本在我的本地系统上的docker容器中没有错误地执行,但似乎不能在GKE上工作。
我正在使用root帐户在GKE上执行脚本。
Dockerfile环境variables设置为: ENV SUEXECUSERGROUP false
shell脚本的path映射到外部持久磁盘。 我已经这样做了,所以我不需要在shell脚本中对任何path进行硬编码:
/ path-to-shell-script /被映射到〜/父文件夹
docker入口点是:
/ usr / local / bin / docker-entrypoint.sh
shell脚本位于:
shell脚本/ path-to-shell-script /fix.sh
加载容器时(初始化)我收到以下错误:
./fix.sh:权限被拒绝
当我从容器内运行ls -lad / path-to-shell-script /时 ,我得到以下输出:
drwxr-sr-x 19 apache apache 4096 / path-to-shell-script /
ls -la / path-to-shell-script /还显示:
… -rwxrwxr-x 1 root root 988 fix.sh …