Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d74f1bc
Fix #1575 - Add cpu_rt_period and cpu_rt_runtime args
tz70s Aug 13, 2017
7fa2cb7
Add join_swarm default listen address
Aug 24, 2017
ff86324
Require at least requests v2.14.2 to fix chardet
timvisee Nov 2, 2017
aa3c4f0
Add unlock_swarm and get_unlock_key to APIClient
shin- Nov 7, 2017
3bd053a
Add unlock methods to Swarm model
shin- Nov 7, 2017
c7f1b5f
dev version
shin- Nov 9, 2017
e6cc3c1
Remove test_update_swarm_name
thaJeztah Nov 11, 2017
1d6b5b2
Merge pull request #1805 from thaJeztah/fix-swarm-update-test
shin- Nov 14, 2017
6e5eb2e
Update service using previous spec
rycus86 Nov 14, 2017
b2d08e6
Service model update changes
rycus86 Nov 14, 2017
c78e73b
Attempting to make service update tests less flaky
rycus86 Nov 15, 2017
828b865
Fix resetting ContainerSpec properties to None
rycus86 Nov 15, 2017
7829b72
Fetch network details with network lists greedily
rycus86 Nov 16, 2017
2878900
Fixing integration tests
rycus86 Nov 19, 2017
58c02ca
Merge pull request #1798 from docker/unlock_swarm_support
shin- Nov 21, 2017
f3dbd01
Fix for #1815: make APIClient.stop honor container StopTimeout value
Anvil Nov 20, 2017
6cce101
Add missing call to string format in log message
alexvy86 Nov 21, 2017
36ed843
Only allow greedy queries on the model
rycus86 Nov 21, 2017
94e3d3d
Merge pull request #1819 from alexvy86/alexvy86-patch-1
shin- Nov 21, 2017
5c57050
Fix common issues with build context creation: inaccessible files and…
shin- Nov 30, 2017
8d770b0
Change format of extra hosts
michaelhankin Dec 3, 2017
0134939
Change format in which hosts are being stored for Swarm services
mhank Dec 6, 2017
9d23278
container: fix docstring for containers()
asottile Dec 7, 2017
b4eb3b9
Merge pull request #1831 from asottile/patch-1
shin- Dec 7, 2017
d8f996f
Merge pull request #1825 from docker/fix-context-building
shin- Dec 11, 2017
61bc8be
Add support for order property when updating a service
michaelhankin Dec 12, 2017
a916bfd
Merge pull request #1830 from mhank/1822-reformat-hosts
shin- Dec 14, 2017
aad0c76
Merge pull request #1812 from rycus86/greedy_network_list
shin- Dec 14, 2017
6f77e45
Merge pull request #1816 from Anvil/honor-stoptimeout
shin- Dec 14, 2017
7db7673
Fix URL-quoting for resource names containing spaces
shin- Dec 14, 2017
6c74292
Merge pull request #1789 from timvisee/chardet-fix
shin- Dec 14, 2017
d7bc8ac
Merge branch 'master' of https://github.com/tz70s/docker-py into tz70…
shin- Dec 14, 2017
445cb18
Add integration test for CPU realtime options
shin- Dec 14, 2017
1df979a
Merge branch 'tz70s-master'
shin- Dec 14, 2017
20b5b58
Merge pull request #1835 from docker/1758-url-quote-path
shin- Dec 14, 2017
a66c892
Renaming new argument
rycus86 Dec 14, 2017
49d0958
Correct default value of order parameter
michaelhankin Dec 14, 2017
644a825
Merge pull request #1834 from mhank/1823-support-update-order
shin- Dec 14, 2017
8cfd4cb
Merge pull request #1807 from rycus86/update_service_from_prev_spec
shin- Dec 14, 2017
b6d0dc1
Fixed DEFAULT API VERSION in docstrings.
feliperuhland Dec 15, 2017
6b8dfe4
Retrieve container logs before container exits / is removed
shin- Dec 14, 2017
1fd5958
Merge pull request #1837 from feliperuhland/fix_default_api_version
shin- Dec 15, 2017
bf699c7
Merge pull request #1836 from docker/1813-run-autoremove
shin- Dec 15, 2017
b20f800
fixes create_api_error_from_http_exception()
Dec 2, 2017
5736436
Merge pull request #1828 from pkit/fix_error_from_httpex
shin- Dec 18, 2017
ac68a36
Merge pull request #1727 from mbelang/join-swarn-default-listen-address
shin- Dec 19, 2017
f10c008
Bump 2.7.0 + changelog
shin- Dec 19, 2017
598f167
Don't attempt to retrieve container's stderr if `auto_remove` was set
shin- Dec 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix common issues with build context creation: inaccessible files and…
… fifos

Signed-off-by: Joffrey F <[email protected]>
  • Loading branch information
shin- committed Nov 30, 2017
commit 5c5705045be72530091a51372ae920f958192bfb
21 changes: 14 additions & 7 deletions docker/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ def create_archive(root, files=None, fileobj=None, gzip=False):
if files is None:
files = build_file_list(root)
for path in files:
i = t.gettarinfo(os.path.join(root, path), arcname=path)
full_path = os.path.join(root, path)
if not os.access(full_path, os.R_OK):
raise IOError(
'Can not access file in context: {}'.format(full_path)
)
i = t.gettarinfo(full_path, arcname=path)
if i is None:
# This happens when we encounter a socket file. We can safely
# ignore it and proceed.
Expand All @@ -108,12 +113,14 @@ def create_archive(root, files=None, fileobj=None, gzip=False):
# and directories executable by default.
i.mode = i.mode & 0o755 | 0o111

try:
# We open the file object in binary mode for Windows support.
with open(os.path.join(root, path), 'rb') as f:
t.addfile(i, f)
except IOError:
# When we encounter a directory the file object is set to None.
if i.isfile():
try:
with open(full_path, 'rb') as f:
t.addfile(i, f)
except IOError:
t.addfile(i, None)
else:
# Directories, FIFOs, symlinks... don't need to be read.
t.addfile(i, None)
t.close()
fileobj.seek(0)
Expand Down