Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
哦,我的Zsh在docker中安装失败_Docker_Zsh_Dockerfile_Oh My Zsh - Fatal编程技术网

哦,我的Zsh在docker中安装失败

哦,我的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

我不知道当我运行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.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;