Docker与Node.js和Express.js
我试图使用我的节点应用程序泊坞窗,我的Dockerfile看起来像这样:
RUN apt-get update RUN apt-get -y install build-essential RUN apt-get install -y nodejs RUN apt-get install -y npm ADD . /src RUN cd /src && npm install EXPOSE 8080 CMD ["node","/src/app.js"]
但是在运行docker build
当npm install
正在运行之后,试图安装https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
我得到一个错误:
The command 'bin/sh -c /src && npm install' returned a non-zero code : 1
什么会导致这样的问题? 我已经尝试安装node-legacy而不是节点,它不起作用
尝试这个:
# put this line on your code (if you are using ubuntu) # this make a link from nodejs to node to add compatibility on ubuntu OS RUN ln -s /usr/bin/nodejs /usr/bin/node # set your current directory with WORKDIR WORKDIR /src RUN sudo npm install
- “morgan”模块与快速应用程序有什么关系?
- Cookie和CookieSession之间的区别?
- Node.js Express护照Cookie过期
- node.js,express.js – 提供单个静态文件最简单的方法是什么?
- 使用webpack-manifest-plugin得到错误'Uncaught SyntaxError:Unexpected token <'
- 在服务器端可以用NGINX使用Webpack-Hot-Middleware吗?
- Node / Express中的JSON模板
- 未findSocket.io.js(node.js + express + socket.io)
- 确保服务器应用程序在摩卡testing开始之前运行