Why is docker build taking so long to run?
<p>I'm running docker build and it's taking an awfully long time to run. Infact, it doesn't complete and I have to CTRL + C to quit.</p>

<p>Last night things were working fine. When I returned to the computer and tried to rebuild it started acting strange.</p>

<p>Here's my command:</p>

<pre><code>docker build -t mywebsite/backend .
</code></pre>

<p>When I ran it I noticed this:</p>

<pre><code>Sending build context to Docker daemon 213.8 MB
Step 1 : FROM ubuntu:14.04
</code></pre>

<p>I have no idea why the file size was 213.8. The only directory that is large is <code>node_modules</code> and that contains <code>.dockerignore</code> so it shouldn't be touching that directory.</p>

<p>After that ran I had an error, so I fixed it and reran:</p>

<pre><code>docker build -t mywebsite/backend .
</code></pre>

<p>This time it just hung. And continues to do so.</p>

<p>Here is my <code>Dockerfile</code></p>

<pre><code>FROM ubuntu:14.04

# Set env. variables
ENV DEBIAN_FRONTEND noninteractive

# Application
ENV APP_PORT 3000

# Amazon
ENV AMAZON_BUCKET mybucket
ENV AMAZON_ACCESS_KEY_ID mykey
ENV AMAZON_SECRET_ACCESS_KEY mytoken

# Set working directory
WORKDIR ~/vms

# Install NodeJS
RUN apt-get update; apt-get install -y curl;
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
RUN apt-get install -y nodejs

# Install node dependencies
ADD package.json package.json
RUN npm install --production

# Copy files to the container
ADD src src

EXPOSE 3000

# Start application
RUN npm start
</code></pre>

<p>The directory I am in when I run the command is the one that contains the Dockerfile:</p>

<pre><code>- backend
  - node_modules
  - src
    - config
    - routes
    - views
    index.js
  Dockerfile
  package.json
</code></pre>

<p>I'm running docker on Ubuntu 14.04</p>