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
5ce02b9f
Kaydet (Commit)
5ce02b9f
authored
Şub 23, 2015
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #500 from dnephin/support_build_dockerfile
Add support for dockerfile
üst
d39da116
0713488f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
client.py
docker/client.py
+8
-2
api.md
docs/api.md
+1
-0
test.py
tests/test.py
+6
-0
No files found.
docker/client.py
Dosyayı görüntüle @
5ce02b9f
...
...
@@ -275,7 +275,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
,
pull
=
True
,
forcerm
=
False
):
forcerm
=
False
,
dockerfile
=
None
):
remote
=
context
=
headers
=
None
if
path
is
None
and
fileobj
is
None
:
raise
TypeError
(
"Either path or fileobj needs to be provided."
)
...
...
@@ -302,6 +302,11 @@ class Client(requests.Session):
if
utils
.
compare_version
(
'1.8'
,
self
.
_version
)
>=
0
:
stream
=
True
if
dockerfile
and
utils
.
compare_version
(
'1.17'
,
self
.
_version
)
<
0
:
raise
errors
.
InvalidVersion
(
'dockerfile was only introduced in API version 1.17'
)
u
=
self
.
_url
(
'/build'
)
params
=
{
't'
:
tag
,
...
...
@@ -310,7 +315,8 @@ class Client(requests.Session):
'nocache'
:
nocache
,
'rm'
:
rm
,
'forcerm'
:
forcerm
,
'pull'
:
pull
'pull'
:
pull
,
'dockerfile'
:
dockerfile
}
if
context
is
not
None
:
...
...
docs/api.md
Dosyayı görüntüle @
5ce02b9f
...
...
@@ -63,6 +63,7 @@ correct value (e.g `gzip`).
*
encoding (str): The encoding for a stream. Set to
`gzip`
for compressing
*
pull (bool): Downloads any updates to the FROM image in Dockerfiles
*
forcerm (bool): Always remove intermediate containers, even after unsuccessful builds
*
dockerfile (str): path within the build context to the Dockerfile
**Returns**
(generator): A generator of the build output
...
...
tests/test.py
Dosyayı görüntüle @
5ce02b9f
...
...
@@ -2095,6 +2095,12 @@ class DockerClientTest(Cleanup, unittest.TestCase):
except
Exception
as
e
:
self
.
fail
(
'Command should not raise exception: {0}'
.
format
(
e
))
def
test_build_container_with_named_dockerfile
(
self
):
try
:
self
.
client
.
build
(
'.'
,
dockerfile
=
'nameddockerfile'
)
except
Exception
as
e
:
self
.
fail
(
'Command should not raise exception: {0}'
.
format
(
e
))
#######################
# PY SPECIFIC TESTS #
#######################
...
...
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