我有以下 Dockerfile:
FROM ubuntu
USER root
RUN apt-get update && apt-get install curl -y
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update && apt-get upgrade -y && apt-get install nodejs -y
RUN mkdir /opt/public
RUN mkdir /opt/bin
ADD public /opt/public
ADD bin /opt/bin
RUN ls -lah /opt/bin
RUN ls -lah /opt/public
ADD run.sh /bin/run.sh
RUN chmod +x /bin/run.sh
RUN cd /opt/bin && npm install
CMD ["/bin/run.sh"]
当我构建容器时,我得到了这个错误:
/bin/sh: 1: npm: 未找到
问题是什么?请你帮助我好吗?
原文由 Sohrab 发布,翻译遵循 CC BY-SA 4.0 许可协议
尝试在构建映像时单独安装
npm
: