Build of Docker image fails

Hi team!

We’re using CircleCI to build Docker-based version of our application.

Here is the content of Docker file we use:

FROM node:6.5

ADD . /var/www/auto-exam

WORKDIR /var/www/auto-exam

RUN apt-get update -qq
RUN apt-get install -qy cron
RUN apt-get install -qy libelf1
RUN npm install

ADD crontab /etc/cron.d/auto-exam-cron
RUN chmod 0644 /etc/cron.d/auto-exam-cron
RUN touch /var/log/cron.log

CMD cron && (npm run watch & npm start)

What happens when the commit on branch is done, that it run CircleCI build which quite often fails ith the following output.

In order to fix it we have to run it several times with the option Rebuild without cache, which after 4-8 times of tries builds correctly.

So i bet smth. messed up on your machines.

Do you have any explanation why do we experience that on almost every commit and the way to make it stable all the time?

Regards
Nick