grammarly/rocker

Ability to delete layer from final image

Closed this issue · 1 comments

I'd really like the ability to delete a layer after the image is built. If not necessarily deleted in terms of the actual image layer, at least trimmed to a 0 bytes size. For example:

FROM debian:stretch

DELETE RUN apt-get update -qq
RUN apt-get install -y rsync

While you'd obviously create all the layers until the end, you'd only need the result of the last run command in this case. The layer result from the previous RUN command is not needed for the final image, and even some of the included RUN command is redundant for size (apt-get caches .deb files on download).

The effect is more pronounced in the case where people are compiling programs, ie, they would only like the resulting layer created from the make install command, possibly deleting a lot of the development dependencies, git checkouts and similar layers before this step.

Much like "MOUNT" would be the counterpart for ADD/COPY, there should be a counterpart for RUN commands which you wouldn't want to include as a layer in the final image.

Thanks for requesting. Unfortunately, we are discontinuing this project. See the notice here: https://github.com/grammarly/rocker/blob/master/README.md

Closing this issue as we are not able to implement it. Sorry.