/ bin / bash:在高山docker中找不到的命令

我试图在一个alpinedocker上运行这个Makefile

 SHELL := /bin/bash build: GOOS=linux go build -o bin/server main.go 

我已经确定, bashmakego都是通过交互式进入容器并检查所有命令的。

但是这个命令神秘地失败了:

 + 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 

我真的很难debugging,因为它在docker,它是jenkins正在执行的一切。

阿尔卑斯山没有/bin/bash

 $ docker run -i -t alpine / # ls /bin/bash ls: /bin/bash: No such file or directory 

请注意,没有makego 。 所以,要么你检查他们的存在,而不是在高山,或者你不使用香草高山。

使用名为apk的包pipe理器,这种方式:

 % docker run --rm -it alpine /bin/sh / # / # apk add --no-cache bash fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz (1/5) Installing ncurses-terminfo-base (6.0-r8) (2/5) Installing ncurses-terminfo (6.0-r8) (3/5) Installing ncurses-libs (6.0-r8) (4/5) Installing readline (6.3.008-r4) (5/5) Installing bash (4.3.46-r5) Executing bash-4.3.46-r5.post-install Executing busybox-1.25.1-r0.trigger OK: 12 MiB in 16 packages / # which -a bash /bin/bash