Just use Spotify's garbage collector by simply running
$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock spotify/docker-gcCreate a Dockerfile.build-context file with the following content:
FROM alpine
RUN apk add tree
COPY . /build-context
WORKDIR /build-context
CMD treeThen run the following
$ docker build -f Dockerfile.build-context -t build-context . && docker run --rm build-contextThis will return a tree view of the build context sent to docker build, i.e. all the files NOT IGNORED by your .gitignore file.
Adapted from https://stackoverflow.com/a/40966234/454743