我尝试在alpine
docker中运行这个Makefile
。
SHELL := /bin/bash
build:
GOOS=linux go build -o bin/server main.go
我已经确定交互式进入容器并检查所有命令后,
bash
、make
和go
都在其中。
但是,这个命令却神秘地失败了:
+ make build
make: /bin/bash: Command not found
GOOS=linux go build -o bin/server main.go
make: /bin/bash: Command not found
make: *** [Makefile:17: build] Error 127
script returned exit code 2
我在调试这个问题时遇到了很大的困难,因为它是在一个 Docker 容器中运行,并且由 jenkins
执行所有操作。
which make
;file /usr/bin/make
(如果它在那里);updatedb; locate make
。 - Ian GibbsSHELL
变量,现在它开始工作了。可能与/bin/bash
有关。 - salient