脚本无法运行,没有这样的文件或目录

时间:2017-02-18 03:22:03

标签: shell unix docker permissions

我创建了一个docker镜像,最后运行脚本在启动时配置我的容器。

执行脚本的docker文件的一部分如下所示

RUN chmod +x /scratch/software/config/config.sh 
CMD /scratch/software/config/config.sh

脚本如下所示

echo "Starting WLS"
whoami
echo $DOMAIN_HOME
cd $DOMAIN_HOME
pwd
ls -ltr ./bin/
sh ./bin/startWeblogic.sh 
tail -f -n0 /etc/hosts
那些whoami pwd等仅用于调试目的。输出是:

Starting WLS
root
/scratch/software/Oracle/Middleware/Wls122120/user_projects/domains/fa_domain
/scratch/software/Oracle/Middleware/Wls122120/user_projects/domains/fa_domain
total 108
drwxr-x--- 2 root root  4096 Feb 11 07:22 service_migration
drwxr-x--- 2 root root  4096 Feb 11 07:22 server_migration
drwxr-x--- 2 root root  4096 Feb 11 07:22 patching
drwxr-x--- 2 root root  4096 Feb 11 07:22 nodemanager
-rwxr-x--- 1 root root  2166 Feb 11 07:27 stopWebLogic.sh
-rwxr-x--- 1 root root   889 Feb 11 07:27 stopRSDaemon.sh
-rwxr-x--- 1 root root  1153 Feb 11 07:27 stopNodeManager.sh
-rwxr-x--- 1 root root  2699 Feb 11 07:27 stopManagedWebLogic.sh
-rwxr-x--- 1 root root  1985 Feb 11 07:27 stopComponent.sh
-rwxr-x--- 1 root root  7211 Feb 11 07:27 startWebLogic.sh
-rwxr-x--- 1 root root   725 Feb 11 07:27 startRSDaemon.sh
-rwxr-x--- 1 root root  1832 Feb 11 07:27 startNodeManager.sh
-rwxr-x--- 1 root root  2928 Feb 11 07:27 startManagedWebLogic.sh
-rwxr-x--- 1 root root  2321 Feb 11 07:27 startComponent.sh
-rwxr-x--- 1 root root 21083 Feb 11 07:27 setStartupEnv.sh
-rwxr-x--- 1 root root   925 Feb 11 07:27 setNMJavaHome.sh
-rwxr-x--- 1 root root 14566 Feb 11 07:27 setDomainEnv.sh
-rwxr-x--- 1 root root  2675 Feb 11 07:27 generateArchive.sh
sh: ./bin/startWeblogic.sh: No such file or directory

我不确定为什么它说没有这样的文件或目录

1 个答案:

答案 0 :(得分:1)

正如我在上面的评论中所提到的,脚本会调用sh ./bin/startWeblogic.sh,其中startWeblogic没有logic上的资金,而在startWebLogic的文件列表中。

相关问题