oh-my-zsh安装将返回非零代码
我试图安装oh-my-zsh作为Docker构build的一部分(使用Dockerfile)。 这里是有问题的dockerfile行:
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
和我得到的错误是:
The command [/bin/sh -c wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh] returned a non-zero code: 1
完整的错误要点在这里
为了debugging,我已经手动运行了这个命令并且它可以工作。 有没有人有运气安装哦,我的zsh作为dockerbuild设的一部分? 任何想法如果以这种方式运行它的行为不同?
构build失败,因为install.sh返回非零代码,当你手动执行脚本时,你忽略了返回代码,但docker失败的构build。 通常非零返回码表示错误,但如果在这种情况下一切正常,你可以忽略这个错误:
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true