【发布时间】:2022-02-02 18:44:40
【问题描述】:
我有以下 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: 未找到
有什么问题?你能帮帮我吗?
【问题讨论】:
标签: node.js docker npm build containers