Linux 无法在ubuntu中执行bash命令:权限被拒绝

Linux 无法在ubuntu中执行bash命令:权限被拒绝,linux,bash,docker,operating-system,Linux,Bash,Docker,Operating System,无法在docker容器中执行bash:ubuntu 这是我的bash脚本(它的调用): 它依次调用此脚本: > #!/usr/bin/env php <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ > > if (PHP_SAPI !== 'cli') { > echo 'bin/magento m

无法在docker容器中执行bash:ubuntu

这是我的bash脚本(它的调用):

它依次调用此脚本:

> #!/usr/bin/env php <?php /**  * Copyright © Magento, Inc. All rights reserved.  * See COPYING.txt for license details.  */
> 
> if (PHP_SAPI !== 'cli') {
>     echo 'bin/magento must be run as a CLI application';
>     exit(1); }
我想执行脚本。我确实有执行它的权限。 这是目录的权限

-rw-r--r--  1 1000 root   68 Jul 23 14:07 clean
-rw-r--r--  1 1000 root  234 Jul 23 14:07 compile
-rw-r--r--  1 1000 root 6148 Jul 23 14:28 .DS_Store
-rw-r--r--  1 1000 root  118 Jul 23 14:07 permissions

您没有执行(
x
)它的权限,除非您将其授予自己:

chmod +x ./bins/clean
您需要这样的权限(前提是您将以
root
身份运行脚本,因为它位于Docker中,所以您可能会这样做):


这个问题有很多重复的地方,例如,只要在谷歌上搜索“bash execute permissions denied”就会得到答案。
-rw-r--r--  1 1000 root   68 Jul 23 14:07 clean
-rw-r--r--  1 1000 root  234 Jul 23 14:07 compile
-rw-r--r--  1 1000 root 6148 Jul 23 14:28 .DS_Store
-rw-r--r--  1 1000 root  118 Jul 23 14:07 permissions
chmod +x ./bins/clean
-rwxr--r--  1 1000 root   68 Jul 23 14:07 clean