ebbishop ebbishop - 1 year ago 170
Node.js Question

Running gulp in `docker-compose build`

I am attempting to include a gulp build process as part of a

build process.


FROM python:3.5.1-onbuild

RUN apt-get update
RUN apt-get install -y nodejs npm
COPY /app/package.json /usr/src/app/app/
WORKDIR /usr/src/app/app
RUN npm install --only=production
RUN npm install --global gulp-cli
RUN gulp

RUN python3 setup.py install
CMD python3 manage.py ${MODE}


build: ${REPO}
- CONFIG_DIR=/config
- MODE=production

Each time I hit
RUN gulp
, I get the error
/usr/bin/env: node: No such file or directory

What am I missing?

Answer Source

Issue could be that you have installed nodejs package and the command expecting node in the $PATH. To test this try running node on the terminal of the container. You can do this using

   docker exec -it <container-hash> bash 

If that is the error you can symlink nodejs to node running below command.

   ln -s /usr/bin/nodejs /usr/bin/node
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download