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
a7cce1d6
Kaydet (Commit)
a7cce1d6
authored
Ara 15, 2014
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #421 from hammerdr/docker-build-pull
Allow for pull as an option to docker build
üst
4a7bb9a9
7426c52f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
client.py
docker/client.py
+3
-2
api.md
docs/api.md
+1
-0
test.py
tests/test.py
+14
-0
No files found.
docker/client.py
Dosyayı görüntüle @
a7cce1d6
...
...
@@ -408,7 +408,7 @@ class Client(requests.Session):
def
build
(
self
,
path
=
None
,
tag
=
None
,
quiet
=
False
,
fileobj
=
None
,
nocache
=
False
,
rm
=
False
,
stream
=
False
,
timeout
=
None
,
custom_context
=
False
,
encoding
=
None
):
custom_context
=
False
,
encoding
=
None
,
pull
=
True
):
remote
=
context
=
headers
=
None
if
path
is
None
and
fileobj
is
None
:
raise
TypeError
(
"Either path or fileobj needs to be provided."
)
...
...
@@ -441,7 +441,8 @@ class Client(requests.Session):
'remote'
:
remote
,
'q'
:
quiet
,
'nocache'
:
nocache
,
'rm'
:
rm
'rm'
:
rm
,
'pull'
:
pull
}
if
context
is
not
None
:
...
...
docs/api.md
Dosyayı görüntüle @
a7cce1d6
...
...
@@ -58,6 +58,7 @@ build output as it happens
*
timeout (int): HTTP timeout
*
custom_context (bool): Optional if using
`fileobj`
*
encoding (str): The encoding for a stream. Set to
`gzip`
for compressing
*
pull (bool): Downloads any updates to the FROM image in Dockerfiles
**Returns**
(generator): A generator of the build output
...
...
tests/test.py
Dosyayı görüntüle @
a7cce1d6
...
...
@@ -1677,6 +1677,20 @@ class DockerClientTest(Cleanup, unittest.TestCase):
except
Exception
as
e
:
self
.
fail
(
'Command should not raise exception: {0}'
.
format
(
e
))
def
test_build_container_pull
(
self
):
script
=
io
.
BytesIO
(
'
\n
'
.
join
([
'FROM busybox'
,
'MAINTAINER docker-py'
,
'RUN mkdir -p /tmp/test'
,
'EXPOSE 8080'
,
'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
' /tmp/silence.tar.gz'
])
.
encode
(
'ascii'
))
try
:
self
.
client
.
build
(
fileobj
=
script
,
pull
=
True
)
except
Exception
as
e
:
self
.
fail
(
'Command should not raise exception: {0}'
.
format
(
e
))
def
test_build_container_stream
(
self
):
script
=
io
.
BytesIO
(
'
\n
'
.
join
([
'FROM busybox'
,
...
...
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