A
A
Arthur2018-05-16 14:34:13
Node.js
Arthur, 2018-05-16 14:34:13

How to execute gulp.task inside docker?

There is a docker file that installs nodejs, copies package.json from the local environment and then installs all dependencies from it (gulp, gulp-cli is installed).

FROM node
COPY scripts .
RUN npm install
EXPOSE 8081

Also copies gulpfile, with a simple task
var gulp = require('gulp');

gulp.task('say', function() {
    console.log('hello');
});

It is not possible to execute this task inside the container, although there is a file and all dependencies are
gulp say
not working, it says in the console that the command was not found

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Askhat Bikmetov, 2018-05-16
@cloudz

In order for the command to be available to run from the shell, gulp must be installed with the -g (global) switch for npm. Or run like this:
$ node node_modules/.bin/gulp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question