Skip to content

Inconsistent build result - Node-Angular2-Webpack application while dockerizing #300

@rajagopal4890

Description

@rajagopal4890

Hi.
I tried dockerizing my angular2 application built with webpack. Used the default node/latest.
Am using windows 10 with docker installed. My dockerfile is as follows:

FROM node:latest

RUN mkdir /WEBapp
WORKDIR /WEBapp

COPY package.json /WEBapp
RUN npm install

COPY . /WEBapp
RUN npm run build

EXPOSE 8000
CMD [ "npm", "run", "serve" ]

When I first did a 'docker build', the image build was successful and I was able to run the container.
When I built the image for the second time, am facing strange build issues while 'npm run build', which is basically a 'webpack' build command.
Am sure my webpack build is fine for two reasons:

  1. I had never faced any issues so far with 'npm run build' during development in my windows 10 as well as ubuntu machine.
  2. This is important. I ran the same thing in my ubuntu machine and no issues. Built the docker image for about 4 times and never got any build error, which I was getting, during my 2nd and successive builds on my windows 10.

I have even looked at my webpack configurations and I see no issues and this only occurs while I try dockerizing the application.
I'll definitely be trying other node images. However, I would like to know what has happened here. Is it Windows10 or this base image.

Refer to the attached file for webpack errors
error.txt

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions