summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sander <michael.sander@gmail.com>2016-02-09 05:10:16 -0500
committerJoffrey F <joffrey@docker.com>2016-03-22 18:13:56 -0700
commitb6d9af59cb948c5085c8f9e47653dfdb33126646 (patch)
tree4466d02f1c674c1e82495f5d0907076a79dde6f7
parent4529dceaaf9c1723ce80c6b8b2c67f605360630c (diff)
downloaddocker-py-b6d9af59cb948c5085c8f9e47653dfdb33126646.tar.gz
Encode the tar ball with gzip
Gzipping this tarball can greatly reduce the time it takes to send a docker file. Signed-off-by: speedplane <mes65@cornell.edu>
-rw-r--r--docker/api/build.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/docker/api/build.py b/docker/api/build.py
index 6bfaba1..c803ce5 100644
--- a/docker/api/build.py
+++ b/docker/api/build.py
@@ -46,7 +46,8 @@ class BuildApiMixin(object):
if os.path.exists(dockerignore):
with open(dockerignore, 'r') as f:
exclude = list(filter(bool, f.read().splitlines()))
- context = utils.tar(path, exclude=exclude, dockerfile=dockerfile)
+ context = utils.tar(path, exclude=exclude, dockerfile=dockerfile, gzip=True)
+ encoding = 'gizp'
if utils.compare_version('1.8', self._version) >= 0:
stream = True