所以我的Dockerfile看起来像这样:
# start from base
FROM ubuntu:18.04
# install system-wide deps for node
RUN apt-get -yqq update
RUN apt-get install -yq wget
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
ENV NVM_DIR="$HOME/.nvm"
RUN [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
RUN [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
RUN nvm install v10.15.1
RUN nvm use v10.15.1
...
当我尝试构建和映像时,它失败了:
Step 6/13 : RUN [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
---> Running in e46106d9dfd8
The command '/bin/sh -c [ -s "$NVM_DIR/nvm.sh" ] && \.
"$NVM_DIR/nvm.sh"' returned a non-zero code: 1
我不明白的是为什么当我运行ubuntu:18.04 image并在终端中执行所有命令时,一切都成功了吗?我该如何解决,我是docker btw的新手。