哦,我的Zsh在docker中安装失败
我不知道当我运行docker文件时,为什么此行返回1:哦,我的Zsh在docker中安装失败,docker,zsh,dockerfile,oh-my-zsh,Docker,Zsh,Dockerfile,Oh My Zsh,我不知道当我运行docker文件时,为什么此行返回1: RUN sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" 我已经安装了wget,但我不知道为什么它返回1(没有错误消息)不知道,但是您不必使用一步安装速记,这可能会让您更好地了解命令失败的地方 RUN set -uex; \ wget https://raw.githubuser
RUN sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
我已经安装了wget,但我不知道为什么它返回1(没有错误消息)不知道,但是您不必使用一步安装速记,这可能会让您更好地了解命令失败的地方
RUN set -uex; \
wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh; \
sh ./install.sh; \
rm ./install.sh
我认为这是由于安装脚本的交互部分 您应该在前面生成
.zshrc
RUN apt-get install -y zsh
RUN git clone https://github.com/robbyrussell/oh-my-zsh \
<installation_path>/.oh-my-zsh
COPY conf/.zshrc <installation_path>/.zshrc
运行apt get install-y zsh
运行git克隆https://github.com/robbyrussell/oh-my-zsh \
/哦,我的天
复制conf/.zshrc/.zshrc
当您运行以下命令安装oh my zsh
时,该命令成功安装了oh my zsh,并以代码1
退出。(您可以运行echo$?
进行检查)
sh-c“$(wgethttps://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O-”
回声$#产出1
但是,docker build shell认为在执行命令时不返回代码0是错误的。为了解决这个问题,我们可以在install命令之后附加一个零返回的命令:
运行sh-c“$(wgethttps://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O-“;出口0;