Dockerfile: ADD vs COPY - CenturyLink Cloud Developer Center
Here we have an ADD instruction which retrieves a package from a URL followed by a RUN instruction which unpacks it, builds it and then attempts to clean-up the downloaded archive.
Unfortunately, since the package retrieval and the rm command are in separate image layers we don't actually save any space in our final image (for a more detailed explanation of this phenomenon, see my Optimizing Docker Images article).
In this case you're better off doing something like this:
RUN curl http://foo.com/package.tar.bz2 \ | tar -xjC /tmp/package \ && make -C /tmp/package Read full article from Dockerfile: ADD vs COPY - CenturyLink Cloud Developer Center
No comments:
Post a Comment