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
5571d1af
Kaydet (Commit)
5571d1af
authored
Kas 09, 2015
tarafından
Leonty
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Support 'buildargs' parameter for docker 1.9.
Signed-off-by:
Leonty Balovnev
<
tigreavecdesailes@gmail.com
>
üst
881e24c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
build.py
docker/api/build.py
+10
-1
build_test.py
tests/integration/build_test.py
+15
-0
No files found.
docker/api/build.py
Dosyayı görüntüle @
5571d1af
import
logging
import
logging
import
os
import
os
import
re
import
re
import
json
from
..
import
constants
from
..
import
constants
from
..
import
errors
from
..
import
errors
...
@@ -16,7 +17,7 @@ class BuildApiMixin(object):
...
@@ -16,7 +17,7 @@ class BuildApiMixin(object):
nocache
=
False
,
rm
=
False
,
stream
=
False
,
timeout
=
None
,
nocache
=
False
,
rm
=
False
,
stream
=
False
,
timeout
=
None
,
custom_context
=
False
,
encoding
=
None
,
pull
=
False
,
custom_context
=
False
,
encoding
=
None
,
pull
=
False
,
forcerm
=
False
,
dockerfile
=
None
,
container_limits
=
None
,
forcerm
=
False
,
dockerfile
=
None
,
container_limits
=
None
,
decode
=
False
):
decode
=
False
,
buildargs
=
None
):
remote
=
context
=
headers
=
None
remote
=
context
=
headers
=
None
container_limits
=
container_limits
or
{}
container_limits
=
container_limits
or
{}
if
path
is
None
and
fileobj
is
None
:
if
path
is
None
and
fileobj
is
None
:
...
@@ -71,6 +72,14 @@ class BuildApiMixin(object):
...
@@ -71,6 +72,14 @@ class BuildApiMixin(object):
}
}
params
.
update
(
container_limits
)
params
.
update
(
container_limits
)
if
buildargs
:
if
utils
.
version_gte
(
self
.
_version
,
'1.21'
):
params
.
update
({
'buildargs'
:
json
.
dumps
(
buildargs
)})
else
:
raise
errors
.
InvalidVersion
(
'buildargs was only introduced in API version 1.21'
)
if
context
is
not
None
:
if
context
is
not
None
:
headers
=
{
'Content-Type'
:
'application/tar'
}
headers
=
{
'Content-Type'
:
'application/tar'
}
if
encoding
:
if
encoding
:
...
...
tests/integration/build_test.py
Dosyayı görüntüle @
5571d1af
...
@@ -96,3 +96,18 @@ class BuildTest(api_test.BaseTestCase):
...
@@ -96,3 +96,18 @@ class BuildTest(api_test.BaseTestCase):
list
(
filter
(
None
,
logs
.
split
(
'
\n
'
))),
list
(
filter
(
None
,
logs
.
split
(
'
\n
'
))),
[
'not-ignored'
],
[
'not-ignored'
],
)
)
@requires_api_version
(
'1.21'
)
def
test_build_with_buildargs
(
self
):
script
=
io
.
BytesIO
(
'
\n
'
.
join
([
'FROM scratch'
,
'ARG test'
,
'USER $test'
])
.
encode
(
'ascii'
))
self
.
client
.
build
(
fileobj
=
script
,
tag
=
'buildargs'
,
buildargs
=
{
'test'
:
'OK'
},
stream
=
True
)
self
.
tmp_imgs
.
append
(
'buildargs'
)
info
=
self
.
client
.
inspect_image
(
'buildargs'
)
self
.
assertEqual
(
info
[
'Config'
][
'User'
],
'OK'
)
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