docker/docker-py — pull request #388 by leth (2014-11-04 10:04:30+00:00)
Title: Walk file tree in order for deterministic builds

Python's `os.walk` does not order the lists of files and directories it returns, so in order to produce a consistent build context tarfile, they should be ordered.

The go client uses [`archive.TarWithOptions`](https://github.com/docker/docker/blob/73057168fa6f8852c52cdc92f790446da865f2e7/pkg/archive/archive.go#L390) which in turn uses go's [`filepath.Walk`](http://golang.org/pkg/path/filepath/#Walk), which states:
>The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient.

:)