我正在尝试使用gulp在docker环境中启动一个webpack编译器。每当我尝试运行该命令(在ssh、Dockerfile或Procfile中)时,它都会失败,错误代码为1,并且不打印任何内容。
我检查了一下,在node_packages中安装了gulp,但是当我从node_packages/.bin运行它时,我得到了相同的响应。运行"npm“可以工作,但是运行"node”似乎也不能工作。
有人知道哪里出了问题吗?
Dockerfile
FROM quay.io/aptible/ubuntu:14.04
# Basic dependencies
RUN apt-install build-essential python-dev python-setuptools
RUN apt-install libxml2-dev libxslt1-dev python-dev
# PostgreSQL dev headers and client (uncomment if you use PostgreSQL)
# RUN apt-install libpq-dev postgresql-client-9.3 postgresql-contrib-9.3
# MySQL dev headers (uncomment if you use MySQL)
RUN apt-install libmysqlclient-dev
RUN easy_install pip
RUN apt-install node
RUN apt-install npm
# Add requirements.txt and package.json ONLY, then run pip install, so that Docker cache won't
# bust when changes are made to other repo files
ADD requirements.txt /app/
ADD package.json /app/
WORKDIR /app
RUN pip install -r requirements.txt
RUN npm install
# Add repo contents to image
ADD . /app/
# RUN npm install -g gulp
# RUN gulp webpack:dev
#django environment variables
# ENV DATABASE_URL xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# ENV SECRET_KEY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# ENV DJANGO_SETTINGS_MODULE xxxxxxxxxxxxx
ENV PORT 3000
EXPOSE 3000过程文件
web: sudo node_modules/.bin/gulp webpack:dev && sudo python app/manage.py runserver 0.0.0.0:$PORT发布于 2016-07-30 10:25:36
更改这些行
RUN apt-install build-essential python-dev python-setuptools
...
RUN apt-install node
RUN apt-install npm对于以下内容:
RUN apt-install build-essential curl python-dev python-setuptools
...
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
RUN apt-get install -y nodejs您会注意到,我们将curl添加到您的工具安装中,并获取节点ppa,然后安装它。这将为您提供该分支上最新版本的节点。它也将与npm一起提供,您不需要单独安装。
取消注释此行,因为您希望gulp是全局安装
# RUN npm install -g gulp相应地,在proc文件中-使用全局吞噬
https://stackoverflow.com/questions/38669089
复制相似问题