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
8ea6ecc0
Kaydet (Commit)
8ea6ecc0
authored
Şub 17, 2017
tarafından
Tomasz Madycki
Kaydeden (comit)
Joffrey F
Mar 18, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add init_path parameter to container HostConfig
Signed-off-by:
Tomasz Madycki
<
tomasz.madycki@gmail.com
>
üst
b00dd488
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
containers.py
docker/models/containers.py
+2
-0
containers.py
docker/types/containers.py
+6
-1
api_container_test.py
tests/integration/api_container_test.py
+12
-0
No files found.
docker/models/containers.py
Dosyayı görüntüle @
8ea6ecc0
...
...
@@ -493,6 +493,7 @@ class ContainerCollection(Collection):
hostname (str): Optional hostname for the container.
init (bool): Run an init inside the container that forwards
signals and reaps processes
init_path (bool): Path to the docker-init binary
ipc_mode (str): Set the IPC mode for the container.
isolation (str): Isolation technology to use. Default: `None`.
labels (dict or list): A dictionary of name-value labels (e.g.
...
...
@@ -817,6 +818,7 @@ RUN_HOST_CONFIG_KWARGS = [
'extra_hosts'
,
'group_add'
,
'init'
,
'init_path'
,
'ipc_mode'
,
'isolation'
,
'kernel_memory'
,
...
...
docker/types/containers.py
Dosyayı görüntüle @
8ea6ecc0
...
...
@@ -118,7 +118,7 @@ class HostConfig(dict):
tmpfs
=
None
,
oom_score_adj
=
None
,
dns_opt
=
None
,
cpu_shares
=
None
,
cpuset_cpus
=
None
,
userns_mode
=
None
,
pids_limit
=
None
,
isolation
=
None
,
auto_remove
=
False
,
storage_opt
=
None
,
init
=
None
):
init
=
None
,
init_path
=
None
):
if
mem_limit
is
not
None
:
self
[
'Memory'
]
=
parse_bytes
(
mem_limit
)
...
...
@@ -423,6 +423,11 @@ class HostConfig(dict):
raise
host_config_version_error
(
'init'
,
'1.25'
)
self
[
'Init'
]
=
init
if
init_path
:
if
version_lt
(
version
,
'1.25'
):
raise
host_config_version_error
(
'init'
,
'1.25'
)
self
[
'InitPath'
]
=
init_path
def
host_config_type_error
(
param
,
param_value
,
expected
):
error_msg
=
'Invalid type for {0} param: expected {1} but found {2}'
...
...
tests/integration/api_container_test.py
Dosyayı görüntüle @
8ea6ecc0
...
...
@@ -451,6 +451,18 @@ class CreateContainerTest(BaseAPIIntegrationTest):
config
=
self
.
client
.
inspect_container
(
ctnr
)
assert
config
[
'HostConfig'
][
'Init'
]
is
True
@requires_api_version
(
'1.25'
)
def
test_create_with_init_path
(
self
):
ctnr
=
self
.
client
.
create_container
(
BUSYBOX
,
'true'
,
host_config
=
self
.
client
.
create_host_config
(
init_path
=
"/usr/libexec/docker-init"
)
)
self
.
tmp_containers
.
append
(
ctnr
[
'Id'
])
config
=
self
.
client
.
inspect_container
(
ctnr
)
assert
config
[
'HostConfig'
][
'InitPath'
]
==
"/usr/libexec/docker-init"
class
VolumeBindTest
(
BaseAPIIntegrationTest
):
def
setUp
(
self
):
...
...
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