2

I created an image from my angular2 app created by angular-cli using below dockerfile.

FROM node:latest

MAINTAINER BHUSHAN GADEKAR

ENV NODE_ENV=production
ENV PORT=4200

COPY    .  /var/www
WORKDIR /var/www


RUN     npm install

EXPOSE  $PORT

ENTRYPOINT ["npm","start"]

After successful creation of image , I tried to run this image using below command

docker run --rm -p 8080:4200 -w "/var/www" bhushan001/angular2-cli npm start

Now I can see my container getting started.but it runs into error that:

ng serve "npm" "start" sh: 1: ng: not found

So I know that angular-cli is not present inside my container but I had installed it locally using npm install in dockerfile.

any inputs?

thanks in advance.

How can I troubleshoot this?

1
  • 2
    install angular-cli globally in your container ie npm install -g angular-cli ? Commented Sep 18, 2016 at 12:05

1 Answer 1

1

use bash -c -l 'npm start' - this ensure your ENV is populated, which you need.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.