0

我正在运行 openjdk:13-alpine docker 容器并将 garmin connectiq-sdk 文件安装到容器中。尝试运行 monkeyc 命令失败并显示“未找到”。

~/projects/garmin$ docker container run --rm -it --name monkeyc -v $(pwd):/home/garmin/ -w /home/garmin/ openjdk:13-alpine ash
/home/garmin # ./connectiq-sdk/bin/monkeyc --version
ash: ./connectiq-sdk/bin/monkeyc: not found

在容器外,命令按预期工作

~/projects/garmin$ ./connectiq-sdk/bin/monkeyc --version
Connect IQ compiler version 3.0.3
4

1 回答 1

0

monkeyc 命令是一个 bash 脚本。容器中的 alpine Linux 上未安装 Bash shell。应该改用灰壳。在 monkeyc 脚本中从 bash 切换到 ash 有效。

~/projects/garmin$ docker container run --rm -it --name monkeyc -v $(pwd):/home/garmin/ -w /home/garmin/ openjdk:13-alpine ash
/home/garmin # ./connectiq-sdk/bin/monkeyc --version
ash: ./connectiq-sdk/bin/monkeyc: not found
/home/garmin # cat ./connectiq-sdk/bin/monkeyc
#!/bin/bash

MB_HOME="$( cd "$( dirname "$0" )" && pwd )"
java -classpath "$MB_HOME"/monkeybrains.jar com.garmin.monkeybrains.Monkeybrains "$@"
/home/garmin # vi ./connectiq-sdk/bin/monkeyc
/home/garmin # ./connectiq-sdk/bin/monkeyc --version
Connect IQ compiler version 3.0.3
/home/garmin # cat ./connectiq-sdk/bin/monkeyc
#!/bin/ash

MB_HOME="$( cd "$( dirname "$0" )" && pwd )"
java -classpath "$MB_HOME"/monkeybrains.jar com.garmin.monkeybrains.Monkeybrains "$@"
于 2019-02-04T02:40:04.913 回答