summaryrefslogtreecommitdiff
path: root/docker/api/build.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-01-03 12:16:21 -0800
committerJoffrey F <joffrey@docker.com>2018-01-03 12:16:21 -0800
commitbf06a361e225c8562e872025fbc836c454cefbae (patch)
treeb500e12009b8d2255cb8715f60ec15977d82db12 /docker/api/build.py
parent190d95c61cc0440108de8a0c14027e72c56b6772 (diff)
downloaddocker-py-1852-dockerignore.tar.gz
Ignore dockerignore lines that contain only whitespace1852-dockerignore
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/api/build.py')
-rw-r--r--docker/api/build.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/docker/api/build.py b/docker/api/build.py
index 9ff2dfb..34456ab 100644
--- a/docker/api/build.py
+++ b/docker/api/build.py
@@ -145,7 +145,9 @@ class BuildApiMixin(object):
exclude = None
if os.path.exists(dockerignore):
with open(dockerignore, 'r') as f:
- exclude = list(filter(bool, f.read().splitlines()))
+ exclude = list(filter(
+ bool, [l.strip() for l in f.read().splitlines()]
+ ))
context = utils.tar(
path, exclude=exclude, dockerfile=dockerfile, gzip=gzip
)