Kaydet (Commit) cbd2ba52 authored tarafından Sebastian Schwarz's avatar Sebastian Schwarz Kaydeden (comit) Christian Bundy

Synthesize executable bit on Windows

The build context is tarred up on the client and then sent to the Docker
daemon.  However Windows permissions don't match the Unix ones.

Therefore we have to mark all files as executable when creating a build
context on Windows, like `docker build` already does:
https://github.com/docker/docker/issues/11047.
Signed-off-by: 's avatarSebastian Schwarz <seschwar@gmail.com>
üst 803ff503
......@@ -4,6 +4,7 @@ import os
import os.path
import json
import shlex
import sys
import tarfile
import tempfile
import warnings
......@@ -92,7 +93,10 @@ def tar(path, exclude=None, dockerfile=None, fileobj=None, gzip=False):
exclude = exclude or []
for path in sorted(exclude_paths(root, exclude, dockerfile=dockerfile)):
t.add(os.path.join(root, path), arcname=path, recursive=False)
i = t.gettarinfo(os.path.join(root, path), arcname=path)
if sys.platform == 'win32':
i.mode = i.mode & 0o755 | 0o111
t.addfile(i)
t.close()
fileobj.seek(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment