fsouza/go-dockerclient — pull request #157 by rafecolton (2014-09-29 05:00:12+00:00)
Title: Create tar stream for builds

This pull request adds `ContextDir` as a new option to `BuildImageOptions`. When `ContextDir` is specified (and no tar input stream is provided), the tar stream will be created for the user.

Much of this code was adapted from the following sections in the docker source code:
- https://github.com/docker/docker/blob/d142b18aab2a3b90959a2ab32676b388a5e98769/api/client/commands.go#L138-L163
- https://github.com/docker/docker/blob/77d30e71122c7ec328f79836dcab4409f72e04b9/utils/utils.go#L522-L564
- https://github.com/docker/docker/blob/77d30e71122c7ec328f79836dcab4409f72e04b9/utils/utils.go#L575-L593
- https://github.com/docker/docker/blob/ba726d9148ee616f0ad069bff6c7732815beb6c6/archive/changes.go#L360-L366
- https://github.com/docker/docker/blob/ba726d9148ee616f0ad069bff6c7732815beb6c6/archive/archive.go#L154-L219
- https://github.com/docker/docker/blob/ba726d9148ee616f0ad069bff6c7732815beb6c6/archive/archive.go#L336-L406