/bin/sh: app: not found

我是研究僧i 提交于 2021-01-29 11:00:43

问题


/ # which chasquid-util
/usr/local/bin/chasquid-util
/ # chasquid-util
/bin/sh: chasquid-util: not found
/ # /usr/local/bin/chasquid-util
/bin/sh: /usr/local/bin/chasquid-util: not found
/ # ls -al /usr/local/bin/
total 27432
drwxr-xr-x    1 root     root          4096 Jul 26 16:18 .
drwxr-xr-x    1 root     root          4096 Jul 26 16:18 ..
-rwxr-xr-x    1 root     root      11721005 Jul 26 16:18 chasquid
-rwxr-xr-x    1 root     root       5510494 Jul 26 16:18 chasquid-util
-rwxr-xr-x    1 root     root       2910713 Jul 26 16:18 mda-lmtp
-rwxr-xr-x    1 root     root       4767277 Jul 26 16:18 smtp-check
-rwxr-xr-x    1 root     root       3164845 Jul 26 16:18 spf-check
/ # 

回答1:


Given your context, this typically means you are missing a shared library. With alpine, it's typically glibc since they ship with libmusl. You can check this with:

ldd chasquid-util

I've got several other reasons for this listed in my DC 2018 slidedeck:

  • Did you run the intended command? (e.g. docker run --rm my_image -it echo hello world will run the command -it)

  • Is docker trying to run a json string? (any json paring errors will show up as executing the json as a string)

  • Does the file exist... in the path and inside the container? (can't run stuff from the host inside a container without building it into the image or mounting a volume)

  • If it is a shell script, check the first line (e.g. #!/bin/bash)

  • Check for windows linefeeds on linux shell scripts (look for ^M or \r with different editors)

  • If it is a binary, there is likely a missing library (use ldd to check)



来源:https://stackoverflow.com/questions/51545316/bin-sh-app-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!