Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created January 21, 2019 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlrobinson/168f2a5fda9b8bb89985e7dad0b774ba to your computer and use it in GitHub Desktop.
Save tlrobinson/168f2a5fda9b8bb89985e7dad0b774ba to your computer and use it in GitHub Desktop.
Script for listing the Docker build context of the current directory
#!/usr/bin/env bash
set -eu
tag=tmp-docker-build-context
docker build --no-cache -t $tag -f - . <<EOD
FROM busybox
RUN mkdir /_/
ADD . /_/
RUN du -a /_
RUN du -d1 /_ | sort -n
EOD
docker image rm $tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment