Reputation: 9222
I am attempting to use gulp inside a Docker container.
I have the following Dockerfile
FROM golang:alpine
RUN apk --update add --no-cache git nodejs
RUN npm install --global gulp
ENV GOPATH=/go PATH=$PATH:/go/bin
VOLUME ["/go/src/github.com/me/sandbox", "/go/pkg","/go/bin"]
WORKDIR /go/src/github.com/me/sandbox
CMD ["gulp"]
and I have the following docker-compose.yml
version: '2'
services:
service:
build: ./service
volumes:
- ./service/src/:/go/src/github.com/me/sandbox
docker-compose build
builds successfully, but when I run docker-compose up
, I get the following error message
Recreating sandbox_service_1
Attaching to sandbox_service_1
service_1 | [22:03:40] Local gulp not found in /go/src/github.com/me/sandbox
service_1 | [22:03:40] Try running: npm install gulp
I have tried several different things to try to fix it.
gulp-cli
globally and locallygulp
locally with npm install gulp
npm install --global gulp
after the WORKDIR
My guess is that it has something to do with the volumes, because when I get rid of anything having to do with a volume, it doesn't complain.
Mr project structure is shown in screenshot below:
Upvotes: 5
Views: 7601
Reputation: 13570
This is what worked for me.
RUN npm install -g gulp
RUN npm link gulp
Upvotes: 5
Reputation: 3227
You need a local version of gulp as well as a global one.
Adding this line should fix your issue
RUN npm i gulp
Upvotes: 3