如何在Ubuntu环境中安装特定版本的节点

问题描述 投票:0回答:1

当我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

有什么区别?

wordpress docker ubuntu nvm
1个回答
0
投票

谢谢David Maze。实际上,不需要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
© www.soinside.com 2019 - 2024. All rights reserved.