当我docker run -it wordpress:php7.0-apache
时,我可以执行以下所有命令
FROM wordpress:php7.0-apache
RUN apt-get update
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
RUN /bin/dash ~/.profile
RUN /bin/dash nvm install 8.11.4
我的问题是,当我尝试docker build -t imageName:version
时会出现错误:
/bin/dash: 0: Can't open nvm
The command '/bin/sh -c /bin/dash nvm install 8.11.4' returned a non-zero code: 1277
有什么区别?
答案 0 :(得分:0)
谢谢大卫迷宫。实际上,不需要nvm安装特定版本。 现在我的Dockerfile:
FROM wordpress:php7.0-apache
RUN apt-get update && apt-get install -y gnupg gnupg2 gnupg1
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs