My Node Dockfile:
# Set the base image to ubuntu
FROM ubuntu
# Define working directory
ADD . /src
WORKDIR /src
# Install Node.js & other
The root cause is => Docker Context. Docker context is copying everything from your root folder to destination container working directory.
So you have to add a .dockerignore file and add these entries (with any other files that you want to ignore)
And now when you will build your container, it will build everything as per container's OS.