Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
ff83cf40
Kaydet (Commit)
ff83cf40
authored
Ock 25, 2017
tarafından
Joffrey F
Kaydeden (comit)
GitHub
Ock 25, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1408 from docker/1407-tar-ignore-sockets
Ignore socket files in utils.tar
üst
8ca5b2b3
93877241
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
Makefile
Makefile
+2
-2
errors.py
docker/errors.py
+1
-1
utils.py
docker/utils/utils.py
+7
-2
utils_test.py
tests/unit/utils_test.py
+15
-0
No files found.
Makefile
Dosyayı görüntüle @
ff83cf40
...
@@ -44,7 +44,7 @@ integration-test-py3: build-py3
...
@@ -44,7 +44,7 @@ integration-test-py3: build-py3
.PHONY
:
integration-dind
.PHONY
:
integration-dind
integration-dind
:
build build-py3
integration-dind
:
build build-py3
docker
rm
-vf
dpy-dind
||
:
docker
rm
-vf
dpy-dind
||
:
docker run
-d
--name
dpy-dind
--privileged
dockerswarm/dind:1.13.0
-rc3
docker daemon
\
docker run
-d
--name
dpy-dind
--privileged
dockerswarm/dind:1.13.0 docker daemon
\
-H
tcp://0.0.0.0:2375
-H
tcp://0.0.0.0:2375
docker run
--rm
--env
=
"DOCKER_HOST=tcp://docker:2375"
--link
=
dpy-dind:docker docker-sdk-python
\
docker run
--rm
--env
=
"DOCKER_HOST=tcp://docker:2375"
--link
=
dpy-dind:docker docker-sdk-python
\
py.test tests/integration
py.test tests/integration
...
@@ -57,7 +57,7 @@ integration-dind-ssl: build-dind-certs build build-py3
...
@@ -57,7 +57,7 @@ integration-dind-ssl: build-dind-certs build build-py3
docker run
-d
--name
dpy-dind-certs dpy-dind-certs
docker run
-d
--name
dpy-dind-certs dpy-dind-certs
docker run
-d
--env
=
"DOCKER_HOST=tcp://localhost:2375"
--env
=
"DOCKER_TLS_VERIFY=1"
\
docker run
-d
--env
=
"DOCKER_HOST=tcp://localhost:2375"
--env
=
"DOCKER_TLS_VERIFY=1"
\
--env
=
"DOCKER_CERT_PATH=/certs"
--volumes-from
dpy-dind-certs
--name
dpy-dind-ssl
\
--env
=
"DOCKER_CERT_PATH=/certs"
--volumes-from
dpy-dind-certs
--name
dpy-dind-ssl
\
-v
/tmp
--privileged
dockerswarm/dind:1.13.0
-rc3
docker daemon
--tlsverify
\
-v
/tmp
--privileged
dockerswarm/dind:1.13.0 docker daemon
--tlsverify
\
--tlscacert
=
/certs/ca.pem
--tlscert
=
/certs/server-cert.pem
\
--tlscacert
=
/certs/ca.pem
--tlscert
=
/certs/server-cert.pem
\
--tlskey
=
/certs/server-key.pem
-H
tcp://0.0.0.0:2375
--tlskey
=
/certs/server-key.pem
-H
tcp://0.0.0.0:2375
docker run
--rm
--volumes-from
dpy-dind-ssl
--env
=
"DOCKER_HOST=tcp://docker:2375"
\
docker run
--rm
--volumes-from
dpy-dind-ssl
--env
=
"DOCKER_HOST=tcp://docker:2375"
\
...
...
docker/errors.py
Dosyayı görüntüle @
ff83cf40
...
@@ -22,7 +22,7 @@ def create_api_error_from_http_exception(e):
...
@@ -22,7 +22,7 @@ def create_api_error_from_http_exception(e):
cls
=
APIError
cls
=
APIError
if
response
.
status_code
==
404
:
if
response
.
status_code
==
404
:
if
explanation
and
(
'No such image'
in
str
(
explanation
)
or
if
explanation
and
(
'No such image'
in
str
(
explanation
)
or
'not found: does not exist or no
read
access'
'not found: does not exist or no
pull
access'
in
str
(
explanation
)):
in
str
(
explanation
)):
cls
=
ImageNotFound
cls
=
ImageNotFound
else
:
else
:
...
...
docker/utils/utils.py
Dosyayı görüntüle @
ff83cf40
...
@@ -4,7 +4,6 @@ import os
...
@@ -4,7 +4,6 @@ import os
import
os.path
import
os.path
import
json
import
json
import
shlex
import
shlex
import
sys
import
tarfile
import
tarfile
import
tempfile
import
tempfile
import
warnings
import
warnings
...
@@ -15,6 +14,7 @@ from fnmatch import fnmatch
...
@@ -15,6 +14,7 @@ from fnmatch import fnmatch
import
requests
import
requests
import
six
import
six
from
..
import
constants
from
..
import
errors
from
..
import
errors
from
..
import
tls
from
..
import
tls
...
@@ -90,7 +90,12 @@ def tar(path, exclude=None, dockerfile=None, fileobj=None, gzip=False):
...
@@ -90,7 +90,12 @@ def tar(path, exclude=None, dockerfile=None, fileobj=None, gzip=False):
for
path
in
sorted
(
exclude_paths
(
root
,
exclude
,
dockerfile
=
dockerfile
)):
for
path
in
sorted
(
exclude_paths
(
root
,
exclude
,
dockerfile
=
dockerfile
)):
i
=
t
.
gettarinfo
(
os
.
path
.
join
(
root
,
path
),
arcname
=
path
)
i
=
t
.
gettarinfo
(
os
.
path
.
join
(
root
,
path
),
arcname
=
path
)
if
sys
.
platform
==
'win32'
:
if
i
is
None
:
# This happens when we encounter a socket file. We can safely
# ignore it and proceed.
continue
if
constants
.
IS_WINDOWS_PLATFORM
:
# Windows doesn't keep track of the execute bit, so we make files
# Windows doesn't keep track of the execute bit, so we make files
# and directories executable by default.
# and directories executable by default.
i
.
mode
=
i
.
mode
&
0
o755
|
0
o111
i
.
mode
=
i
.
mode
&
0
o755
|
0
o111
...
...
tests/unit/utils_test.py
Dosyayı görüntüle @
ff83cf40
...
@@ -5,6 +5,7 @@ import json
...
@@ -5,6 +5,7 @@ import json
import
os
import
os
import
os.path
import
os.path
import
shutil
import
shutil
import
socket
import
sys
import
sys
import
tarfile
import
tarfile
import
tempfile
import
tempfile
...
@@ -894,6 +895,20 @@ class TarTest(unittest.TestCase):
...
@@ -894,6 +895,20 @@ class TarTest(unittest.TestCase):
sorted
(
tar_data
.
getnames
()),
[
'bar'
,
'bar/foo'
,
'foo'
]
sorted
(
tar_data
.
getnames
()),
[
'bar'
,
'bar/foo'
,
'foo'
]
)
)
def
test_tar_socket_file
(
self
):
base
=
tempfile
.
mkdtemp
()
self
.
addCleanup
(
shutil
.
rmtree
,
base
)
for
d
in
[
'foo'
,
'bar'
]:
os
.
makedirs
(
os
.
path
.
join
(
base
,
d
))
sock
=
socket
.
socket
(
socket
.
AF_UNIX
)
self
.
addCleanup
(
sock
.
close
)
sock
.
bind
(
os
.
path
.
join
(
base
,
'test.sock'
))
with
tar
(
base
)
as
archive
:
tar_data
=
tarfile
.
open
(
fileobj
=
archive
)
self
.
assertEqual
(
sorted
(
tar_data
.
getnames
()),
[
'bar'
,
'foo'
]
)
class
ShouldCheckDirectoryTest
(
unittest
.
TestCase
):
class
ShouldCheckDirectoryTest
(
unittest
.
TestCase
):
exclude_patterns
=
[
exclude_patterns
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment