This is caused by Docker bug 6345 which is already closed, but for some
reason the problem still persists. Closes GH-181. Patch contributed
by Michael Zedeler.
While COPY and ADD are essentially interchangeable here, it is still
considered good practice to use COPY whenever possible. From the docker
docks on best practices:
"Although ADD and COPY are functionally similar, generally speaking,
COPY is preferred. That’s because it’s more transparent than ADD.
[...] For other items (files, directories) that do not require ADD’s tar
auto-extraction capability, you should always use COPY."
Additionally, ADD commands were not cached prior to 0.7.3 (which was
released on 2013-01-02).
The ADD command will create /build automatically, so the RUN mkdir step
can be safely removed. Also, this has the benefit of reducing the number
of steps in the Dockerfile which is helpful for not as quickly hitting
the 127 layer limit.