D:\Users\W9013134>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f583ad35a254 devhub.baymax.oppoer.me/member-rpc/hyperf-node:v2.0 "bash" 21 seconds ago Up 13 seconds 0.0.0.0:8080->8080/tcp server-client-test-1
c61ae7ad3f34 devhub.baymax.oppoer.me/member-rpc/hyperf-node:v2.0 "bash" 3 hours ago Up 3 hours 0.0.0.0:8099->8000/tcp server-member-open-api-1
841ca72e021b devhub.baymax.oppoer.me/member-rpc/hyperf-node:v2.0 "bash" 5 hours ago Up 3 hours 0.0.0.0:8000->8000/tcp server-member-client-api-1
D:\Users\W9013134>docker exec -it server-client-test-1 bash
[root@f583ad35a254 /]# cd /var/www/bin
[root@f583ad35a254 bin]# ls
hyperf.php
[root@f583ad35a254 bin]# cd ../vendor/bin
[root@f583ad35a254 bin]# ls
carbon co-phpunit php-cs-fixer php-parse phpstan phpstan.phar phpunit start.sh
[root@f583ad35a254 bin]# cat -A start.sh
XSym$
0035$
772a75c8f1277b0eb3fbb1f956dcd085$
../oppo-member/lib/src/bin/start.sh$
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^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@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
[root@f583ad35a254 bin]# bash start.sh
start.sh: line 1: XSym: command not found
start.sh: line 2: 0035: command not found
start.sh: line 3: 772a75c8f1277b0eb3fbb1f956dcd085: command not found
Could not open input file: bin/hyperf.php
[root@f583ad35a254 bin]#
[root@f583ad35a254 bin]# sh start.sh
start.sh: line 1: XSym: command not found
start.sh: line 2: 0035: command not found
start.sh: line 3: 772a75c8f1277b0eb3fbb1f956dcd085: command not found
Could not open input file: bin/hyperf.php
[root@f583ad35a254 bin]# ll
total 32
-rwxrwxrwx 1 root root 1067 Dec 9 2021 carbon
-rwxrwxrwx 1 root root 1067 Dec 9 2021 co-phpunit
-rwxrwxrwx 1 root root 1067 Dec 9 2021 php-cs-fixer
-rwxrwxrwx 1 root root 1067 Dec 9 2021 php-parse
-rwxrwxrwx 1 root root 1067 Dec 9 2021 phpstan
-rwxrwxrwx 1 root root 1067 Dec 9 2021 phpstan.phar
-rwxrwxrwx 1 root root 1067 Dec 9 2021 phpunit
-rwxrwxrwx 1 root root 1067 Dec 7 02:00 start.sh
[root@f583ad35a254 bin]# chmod 777 start.sh
[root@f583ad35a254 bin]# ./start.sh
./start.sh: line 1: XSym: command not found
./start.sh: line 2: 0035: command not found
./start.sh: line 3: 772a75c8f1277b0eb3fbb1f956dcd085: command not found
Could not open input file: bin/hyperf.php
[root@f583ad35a254 bin]# ll
total 32
-rwxrwxrwx 1 root root 1067 Dec 9 2021 carbon
-rwxrwxrwx 1 root root 1067 Dec 9 2021 co-phpunit
-rwxrwxrwx 1 root root 1067 Dec 9 2021 php-cs-fixer
-rwxrwxrwx 1 root root 1067 Dec 9 2021 php-parse
-rwxrwxrwx 1 root root 1067 Dec 9 2021 phpstan
-rwxrwxrwx 1 root root 1067 Dec 9 2021 phpstan.phar
-rwxrwxrwx 1 root root 1067 Dec 9 2021 phpunit
-rwxrwxrwx 1 root root 1067 Dec 7 02:00 start.sh
[root@f583ad35a254 bin]#
正常的没被转化成二进制的start.sh文件内容如下:
#!/bin/bash
cd $(dirname $0)
cd ../../
logDir="/home/service/var/logs"
if [ -d ${logDir} ];then
mkdir -p ${logDir}
fi
php bin/hyperf.php start
可识别执行成功
[root@23126004eb75 bin]# ls
carbon co-phpunit php-cs-fixer php-parse phpstan phpstan.phar phpunit start.sh
[root@23126004eb75 bin]# ./start.sh
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Config\Listener\RegisterPropertyHandlerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Oppo\Hyperf\JsonRpc\RegisterProtocolListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Oppo\Hyperf\GrpcClient\Listener\AddConsumerDefinitionListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\RpcClient\Listener\AddConsumerDefinitionListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Paginator\Listener\PageResolverListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\JsonRpc\Listener\RegisterProtocolListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\ExceptionHandler\Listener\ExceptionHandlerListener listener.
找的部分网上资料
https://learnku.com/laravel/t/42181
https://stackoverflow.com/questions/54732023/xsym-not-found-while-executing-binary-in-docker-on-windows
https://ithelp.ithome.com.tw/articles/10234655
https://blog.csdn.net/ron03129596/article/details/124832706