Buildkit Dockerfile Frontend Caching
Ok, where was I? In the last blog post (BuildKit Dockerfile Frontend) scratching the surface by introcuding here-docs in Dockerfiles. The original inspiration for the post - series, as it turned out - was my to cut the cristiangreco/docker-pdflatex image down by a GB or so.
I went from this:
to this:
RUN <<eot bash
apt-get update
apt-cache depends texlive-full \
| grep "Depends:" \
| grep -v "doc$" \
| egrep -v "texlive-(games|music)" \
| egrep -v "texlive-lang-(arabic|cjk|chinese|cyrillic|czechslovak|european|french|german|greek|italian|japanese|korean|other|polish|portuguese|spanish)$" \
| cut -d ' ' -f 4 \
| xargs apt-get install --no-install-recommends -y
apt-get autoremove
eot