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
045bad2e
Kaydet (Commit)
045bad2e
authored
Ock 18, 2017
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix a number of docs formatting issues
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
9c6d76fd
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
94 additions
and
99 deletions
+94
-99
container.py
docker/api/container.py
+24
-24
network.py
docker/api/network.py
+11
-10
service.py
docker/api/service.py
+15
-17
swarm.py
docker/api/swarm.py
+2
-2
containers.py
docker/models/containers.py
+16
-16
networks.py
docker/models/networks.py
+10
-9
services.py
docker/models/services.py
+9
-11
networks.py
docker/types/networks.py
+1
-1
services.py
docker/types/services.py
+5
-5
api.rst
docs/api.rst
+0
-2
index.rst
docs/index.rst
+1
-2
No files found.
docker/api/container.py
Dosyayı görüntüle @
045bad2e
...
@@ -388,13 +388,13 @@ class ContainerApiMixin(object):
...
@@ -388,13 +388,13 @@ class ContainerApiMixin(object):
environment (dict or list): A dictionary or a list of strings in
environment (dict or list): A dictionary or a list of strings in
the following format ``["PASSWORD=xxx"]`` or
the following format ``["PASSWORD=xxx"]`` or
``{"PASSWORD": "xxx"}``.
``{"PASSWORD": "xxx"}``.
dns (
list): DNS name servers. Deprecated since API version 1.10.
dns (
:py:class:`list`): DNS name servers. Deprecated since API
Use ``host_config`` instead.
version 1.10.
Use ``host_config`` instead.
dns_opt (
list): Additional options to be added to the container's
dns_opt (
:py:class:`list`): Additional options to be added to the
``resolv.conf`` file
container's
``resolv.conf`` file
volumes (str or list):
volumes (str or list):
volumes_from (
list): List of container names or Ids to get
volumes_from (
:py:class:`list`): List of container names or Ids to
volumes from.
get
volumes from.
network_disabled (bool): Disable networking
network_disabled (bool): Disable networking
name (str): A name for the container
name (str): A name for the container
entrypoint (str or list): An entrypoint
entrypoint (str or list): An entrypoint
...
@@ -478,19 +478,19 @@ class ContainerApiMixin(object):
...
@@ -478,19 +478,19 @@ class ContainerApiMixin(object):
device_write_bps: Limit write rate (bytes per second) from a
device_write_bps: Limit write rate (bytes per second) from a
device.
device.
device_write_iops: Limit write rate (IO per second) from a device.
device_write_iops: Limit write rate (IO per second) from a device.
devices (
list): Expose host devices to the container, as a list
devices (
:py:class:`list`): Expose host devices to the container,
of strings in the form
as a list
of strings in the form
``<path_on_host>:<path_in_container>:<cgroup_permissions>``.
``<path_on_host>:<path_in_container>:<cgroup_permissions>``.
For example, ``/dev/sda:/dev/xvda:rwm`` allows the container
For example, ``/dev/sda:/dev/xvda:rwm`` allows the container
to have read-write access to the host's ``/dev/sda`` via a
to have read-write access to the host's ``/dev/sda`` via a
node named ``/dev/xvda`` inside the container.
node named ``/dev/xvda`` inside the container.
dns (
list
): Set custom DNS servers.
dns (
:py:class:`list`
): Set custom DNS servers.
dns_search (
list
): DNS search domains.
dns_search (
:py:class:`list`
): DNS search domains.
extra_hosts (dict): Addtional hostnames to resolve inside the
extra_hosts (dict): Addtional hostnames to resolve inside the
container, as a mapping of hostname to IP address.
container, as a mapping of hostname to IP address.
group_add (
list): List of additional group names and/or IDs that
group_add (
:py:class:`list`): List of additional group names and/or
the container process will run as.
IDs that
the container process will run as.
ipc_mode (str): Set the IPC mode for the container.
ipc_mode (str): Set the IPC mode for the container.
isolation (str): Isolation technology to use. Default: `None`.
isolation (str): Isolation technology to use. Default: `None`.
links (dict or list of tuples): Either a dictionary mapping name
links (dict or list of tuples): Either a dictionary mapping name
...
@@ -539,8 +539,8 @@ class ContainerApiMixin(object):
...
@@ -539,8 +539,8 @@ class ContainerApiMixin(object):
- ``Name`` One of ``on-failure``, or ``always``.
- ``Name`` One of ``on-failure``, or ``always``.
- ``MaximumRetryCount`` Number of times to restart the
- ``MaximumRetryCount`` Number of times to restart the
container on failure.
container on failure.
security_opt (
list): A list of string values to customize labels
security_opt (
:py:class:`list`): A list of string values to
for MLS systems, such as SELinux.
customize labels
for MLS systems, such as SELinux.
shm_size (str or int): Size of /dev/shm (e.g. ``1G``).
shm_size (str or int): Size of /dev/shm (e.g. ``1G``).
sysctls (dict): Kernel parameters to set in the container.
sysctls (dict): Kernel parameters to set in the container.
tmpfs (dict): Temporary filesystems to mount, as a dictionary
tmpfs (dict): Temporary filesystems to mount, as a dictionary
...
@@ -555,13 +555,13 @@ class ContainerApiMixin(object):
...
@@ -555,13 +555,13 @@ class ContainerApiMixin(object):
'/mnt/vol1': 'size=3G,uid=1000'
'/mnt/vol1': 'size=3G,uid=1000'
}
}
ulimits (
list): Ulimits to set inside the container, as a list of
ulimits (
:py:class:`list`): Ulimits to set inside the container,
dicts.
as a list of
dicts.
userns_mode (str): Sets the user namespace mode for the container
userns_mode (str): Sets the user namespace mode for the container
when user namespace remapping option is enabled. Supported
when user namespace remapping option is enabled. Supported
values are: ``host``
values are: ``host``
volumes_from (
list): List of container names or IDs to get
volumes_from (
:py:class:`list`): List of container names or IDs to
volumes from.
get
volumes from.
Returns:
Returns:
...
@@ -618,17 +618,17 @@ class ContainerApiMixin(object):
...
@@ -618,17 +618,17 @@ class ContainerApiMixin(object):
:py:meth:`create_networking_config`.
:py:meth:`create_networking_config`.
Args:
Args:
aliases (list): A list of aliases for this endpoint. Names in
aliases (:py:class:`list`): A list of aliases for this endpoint.
that list can be used within the network to reach the
Names in that list can be used within the network to reach the
container. Defaults to ``None``.
links (:py:class:`list`): A list of links for this endpoint.
Containers declared in this list will be linked to this
container. Defaults to ``None``.
container. Defaults to ``None``.
links (list): A list of links for this endpoint. Containers
declared in this list will be linked to this container.
Defaults to ``None``.
ipv4_address (str): The IP address of this container on the
ipv4_address (str): The IP address of this container on the
network, using the IPv4 protocol. Defaults to ``None``.
network, using the IPv4 protocol. Defaults to ``None``.
ipv6_address (str): The IP address of this container on the
ipv6_address (str): The IP address of this container on the
network, using the IPv6 protocol. Defaults to ``None``.
network, using the IPv6 protocol. Defaults to ``None``.
link_local_ips (
list
): A list of link-local (IPv4/IPv6)
link_local_ips (
:py:class:`list`
): A list of link-local (IPv4/IPv6)
addresses.
addresses.
Returns:
Returns:
...
...
docker/api/network.py
Dosyayı görüntüle @
045bad2e
...
@@ -11,13 +11,13 @@ class NetworkApiMixin(object):
...
@@ -11,13 +11,13 @@ class NetworkApiMixin(object):
List networks. Similar to the ``docker networks ls`` command.
List networks. Similar to the ``docker networks ls`` command.
Args:
Args:
names (
list
): List of names to filter by
names (
:py:class:`list`
): List of names to filter by
ids (
list
): List of ids to filter by
ids (
:py:class:`list`
): List of ids to filter by
filters (dict): Filters to be processed on the network list.
filters (dict): Filters to be processed on the network list.
Available filters:
Available filters:
- ``driver=[<driver-name>]`` Matches a network's driver.
- ``driver=[<driver-name>]`` Matches a network's driver.
- ``label=[<key>]`` or ``label=[<key>=<value>]``.
- ``label=[<key>]`` or ``label=[<key>=<value>]``.
- ``type=["custom"|"builtin"]
`` Filters networks by type.
- ``type=["custom"|"builtin"]`` Filters networks by type.
Returns:
Returns:
(dict): List of network objects.
(dict): List of network objects.
...
@@ -169,17 +169,18 @@ class NetworkApiMixin(object):
...
@@ -169,17 +169,18 @@ class NetworkApiMixin(object):
Args:
Args:
container (str): container-id/name to be connected to the network
container (str): container-id/name to be connected to the network
net_id (str): network id
net_id (str): network id
aliases (
list): A list of aliases for this endpoint. Names in that
aliases (
:py:class:`list`): A list of aliases for this endpoint.
list can be used within the network to reach the container.
Names in that list can be used within the network to reach the
Defaults to ``None``.
container.
Defaults to ``None``.
links (
list): A list of links for this endpoint. Containers
links (
:py:class:`list`): A list of links for this endpoint.
declared in this list will be linkedto this container.
Containers declared in this list will be linked to this
Defaults to ``None``.
container.
Defaults to ``None``.
ipv4_address (str): The IP address of this container on the
ipv4_address (str): The IP address of this container on the
network, using the IPv4 protocol. Defaults to ``None``.
network, using the IPv4 protocol. Defaults to ``None``.
ipv6_address (str): The IP address of this container on the
ipv6_address (str): The IP address of this container on the
network, using the IPv6 protocol. Defaults to ``None``.
network, using the IPv6 protocol. Defaults to ``None``.
link_local_ips (list): A list of link-local (IPv4/IPv6) addresses.
link_local_ips (:py:class:`list`): A list of link-local
(IPv4/IPv6) addresses.
"""
"""
data
=
{
data
=
{
"Container"
:
container
,
"Container"
:
container
,
...
...
docker/api/service.py
Dosyayı görüntüle @
045bad2e
...
@@ -13,18 +13,18 @@ class ServiceApiMixin(object):
...
@@ -13,18 +13,18 @@ class ServiceApiMixin(object):
Create a service.
Create a service.
Args:
Args:
task_template (
dict): Specification of the task to start as part
task_template (
TaskTemplate): Specification of the task to start as
of the new service.
part
of the new service.
name (string): User-defined name for the service. Optional.
name (string): User-defined name for the service. Optional.
labels (dict): A map of labels to associate with the service.
labels (dict): A map of labels to associate with the service.
Optional.
Optional.
mode (string): Scheduling mode for the service (``replicated`` or
mode (string): Scheduling mode for the service (``replicated`` or
``global``). Defaults to ``replicated``.
``global``). Defaults to ``replicated``.
update_config (
dict): Specification for the update strategy of the
update_config (
UpdateConfig): Specification for the update strategy
service. Default: ``None``
of the
service. Default: ``None``
networks (
list): List of network names or IDs to attach the
networks (
:py:class:`list`): List of network names or IDs to attach
service to. Default: ``None``.
the
service to. Default: ``None``.
endpoint_
config (dict
): Properties that can be configured to
endpoint_
spec (EndpointSpec
): Properties that can be configured to
access and load balance a service. Default: ``None``.
access and load balance a service. Default: ``None``.
Returns:
Returns:
...
@@ -159,7 +159,7 @@ class ServiceApiMixin(object):
...
@@ -159,7 +159,7 @@ class ServiceApiMixin(object):
``label`` and ``desired-state``.
``label`` and ``desired-state``.
Returns:
Returns:
(
list
): List of task dictionaries.
(
:py:class:`list`
): List of task dictionaries.
Raises:
Raises:
:py:class:`docker.errors.APIError`
:py:class:`docker.errors.APIError`
...
@@ -186,20 +186,18 @@ class ServiceApiMixin(object):
...
@@ -186,20 +186,18 @@ class ServiceApiMixin(object):
ID).
ID).
version (int): The version number of the service object being
version (int): The version number of the service object being
updated. This is required to avoid conflicting writes.
updated. This is required to avoid conflicting writes.
task_template (dict): Specification of the updated task to start
task_template (TaskTemplate): Specification of the updated task to
as part of the service. See the [TaskTemplate
start as part of the service.
class](#TaskTemplate) for details.
name (string): New name for the service. Optional.
name (string): New name for the service. Optional.
labels (dict): A map of labels to associate with the service.
labels (dict): A map of labels to associate with the service.
Optional.
Optional.
mode (string): Scheduling mode for the service (``replicated`` or
mode (string): Scheduling mode for the service (``replicated`` or
``global``). Defaults to ``replicated``.
``global``). Defaults to ``replicated``.
update_config (dict): Specification for the update strategy of the
update_config (UpdateConfig): Specification for the update strategy
service. See the [UpdateConfig class](#UpdateConfig) for
of the service. Default: ``None``.
details. Default: ``None``.
networks (:py:class:`list`): List of network names or IDs to attach
networks (list): List of network names or IDs to attach the
the service to. Default: ``None``.
service to. Default: ``None``.
endpoint_spec (EndpointSpec): Properties that can be configured to
endpoint_config (dict): Properties that can be configured to
access and load balance a service. Default: ``None``.
access and load balance a service. Default: ``None``.
Returns:
Returns:
...
...
docker/api/swarm.py
Dosyayı görüntüle @
045bad2e
...
@@ -143,8 +143,8 @@ class SwarmApiMixin(object):
...
@@ -143,8 +143,8 @@ class SwarmApiMixin(object):
Make this Engine join a swarm that has already been created.
Make this Engine join a swarm that has already been created.
Args:
Args:
remote_addrs (
list): Addresses of one or more manager nodes already
remote_addrs (
:py:class:`list`): Addresses of one or more manager
participating in the Swarm to join.
nodes already
participating in the Swarm to join.
join_token (string): Secret token for joining this Swarm.
join_token (string): Secret token for joining this Swarm.
listen_addr (string): Listen address used for inter-manager
listen_addr (string): Listen address used for inter-manager
communication if the node gets promoted to manager, as well as
communication if the node gets promoted to manager, as well as
...
...
docker/models/containers.py
Dosyayı görüntüle @
045bad2e
...
@@ -468,17 +468,17 @@ class ContainerCollection(Collection):
...
@@ -468,17 +468,17 @@ class ContainerCollection(Collection):
device_write_bps: Limit write rate (bytes per second) from a
device_write_bps: Limit write rate (bytes per second) from a
device.
device.
device_write_iops: Limit write rate (IO per second) from a device.
device_write_iops: Limit write rate (IO per second) from a device.
devices (
list): Expose host devices to the container, as a list
devices (
:py:class:`list`): Expose host devices to the container,
of strings in the form
as a list
of strings in the form
``<path_on_host>:<path_in_container>:<cgroup_permissions>``.
``<path_on_host>:<path_in_container>:<cgroup_permissions>``.
For example, ``/dev/sda:/dev/xvda:rwm`` allows the container
For example, ``/dev/sda:/dev/xvda:rwm`` allows the container
to have read-write access to the host's ``/dev/sda`` via a
to have read-write access to the host's ``/dev/sda`` via a
node named ``/dev/xvda`` inside the container.
node named ``/dev/xvda`` inside the container.
dns (
list
): Set custom DNS servers.
dns (
:py:class:`list`
): Set custom DNS servers.
dns_opt (
list): Additional options to be added to the container's
dns_opt (
:py:class:`list`): Additional options to be added to the
``resolv.conf`` file.
container's
``resolv.conf`` file.
dns_search (
list
): DNS search domains.
dns_search (
:py:class:`list`
): DNS search domains.
domainname (str or list): Set custom DNS search domains.
domainname (str or list): Set custom DNS search domains.
entrypoint (str or list): The entrypoint for the container.
entrypoint (str or list): The entrypoint for the container.
environment (dict or list): Environment variables to set inside
environment (dict or list): Environment variables to set inside
...
@@ -486,8 +486,8 @@ class ContainerCollection(Collection):
...
@@ -486,8 +486,8 @@ class ContainerCollection(Collection):
format ``["SOMEVARIABLE=xxx"]``.
format ``["SOMEVARIABLE=xxx"]``.
extra_hosts (dict): Addtional hostnames to resolve inside the
extra_hosts (dict): Addtional hostnames to resolve inside the
container, as a mapping of hostname to IP address.
container, as a mapping of hostname to IP address.
group_add (
list): List of additional group names and/or IDs that
group_add (
:py:class:`list`): List of additional group names and/or
the container process will run as.
IDs that
the container process will run as.
hostname (str): Optional hostname for the container.
hostname (str): Optional hostname for the container.
ipc_mode (str): Set the IPC mode for the container.
ipc_mode (str): Set the IPC mode for the container.
isolation (str): Isolation technology to use. Default: `None`.
isolation (str): Isolation technology to use. Default: `None`.
...
@@ -517,8 +517,8 @@ class ContainerCollection(Collection):
...
@@ -517,8 +517,8 @@ class ContainerCollection(Collection):
behavior. Accepts number between 0 and 100.
behavior. Accepts number between 0 and 100.
memswap_limit (str or int): Maximum amount of memory + swap a
memswap_limit (str or int): Maximum amount of memory + swap a
container is allowed to consume.
container is allowed to consume.
networks (
list): A list of network names to connect this
networks (
:py:class:`list`): A list of network names to connect
container to.
this
container to.
name (str): The name for this container.
name (str): The name for this container.
network_disabled (bool): Disable networking.
network_disabled (bool): Disable networking.
network_mode (str): One of:
network_mode (str): One of:
...
@@ -574,8 +574,8 @@ class ContainerCollection(Collection):
...
@@ -574,8 +574,8 @@ class ContainerCollection(Collection):
For example:
For example:
``{"Name": "on-failure", "MaximumRetryCount": 5}``
``{"Name": "on-failure", "MaximumRetryCount": 5}``
security_opt (
list): A list of string values to customize labels
security_opt (
:py:class:`list`): A list of string values to
for MLS systems, such as SELinux.
customize labels
for MLS systems, such as SELinux.
shm_size (str or int): Size of /dev/shm (e.g. ``1G``).
shm_size (str or int): Size of /dev/shm (e.g. ``1G``).
stdin_open (bool): Keep ``STDIN`` open even if not attached.
stdin_open (bool): Keep ``STDIN`` open even if not attached.
stdout (bool): Return logs from ``STDOUT`` when ``detach=False``.
stdout (bool): Return logs from ``STDOUT`` when ``detach=False``.
...
@@ -598,8 +598,8 @@ class ContainerCollection(Collection):
...
@@ -598,8 +598,8 @@ class ContainerCollection(Collection):
}
}
tty (bool): Allocate a pseudo-TTY.
tty (bool): Allocate a pseudo-TTY.
ulimits (
list): Ulimits to set inside the container, as a list of
ulimits (
:py:class:`list`): Ulimits to set inside the container, as
dicts.
a list of
dicts.
user (str or int): Username or UID to run commands as inside the
user (str or int): Username or UID to run commands as inside the
container.
container.
userns_mode (str): Sets the user namespace mode for the container
userns_mode (str): Sets the user namespace mode for the container
...
@@ -621,8 +621,8 @@ class ContainerCollection(Collection):
...
@@ -621,8 +621,8 @@ class ContainerCollection(Collection):
{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},
{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},
'/var/www': {'bind': '/mnt/vol1', 'mode': 'ro'}}
'/var/www': {'bind': '/mnt/vol1', 'mode': 'ro'}}
volumes_from (
list): List of container names or IDs to get
volumes_from (
:py:class:`list`): List of container names or IDs to
volumes from.
get
volumes from.
working_dir (str): Path to the working directory.
working_dir (str): Path to the working directory.
Returns:
Returns:
...
...
docker/models/networks.py
Dosyayı görüntüle @
045bad2e
...
@@ -32,17 +32,18 @@ class Network(Model):
...
@@ -32,17 +32,18 @@ class Network(Model):
container (str): Container to connect to this network, as either
container (str): Container to connect to this network, as either
an ID, name, or :py:class:`~docker.models.containers.Container`
an ID, name, or :py:class:`~docker.models.containers.Container`
object.
object.
aliases (
list): A list of aliases for this endpoint. Names in that
aliases (
:py:class:`list`): A list of aliases for this endpoint.
list can be used within the network to reach the container.
Names in that list can be used within the network to reach the
Defaults to ``None``.
container.
Defaults to ``None``.
links (
list): A list of links for this endpoint. Containers
links (
:py:class:`list`): A list of links for this endpoint.
declared in this list will be linkedto this container.
Containers declared in this list will be linkedto this
Defaults to ``None``.
container.
Defaults to ``None``.
ipv4_address (str): The IP address of this container on the
ipv4_address (str): The IP address of this container on the
network, using the IPv4 protocol. Defaults to ``None``.
network, using the IPv4 protocol. Defaults to ``None``.
ipv6_address (str): The IP address of this container on the
ipv6_address (str): The IP address of this container on the
network, using the IPv6 protocol. Defaults to ``None``.
network, using the IPv6 protocol. Defaults to ``None``.
link_local_ips (list): A list of link-local (IPv4/IPv6) addresses.
link_local_ips (:py:class:`list`): A list of link-local (IPv4/IPv6)
addresses.
Raises:
Raises:
:py:class:`docker.errors.APIError`
:py:class:`docker.errors.APIError`
...
@@ -167,8 +168,8 @@ class NetworkCollection(Collection):
...
@@ -167,8 +168,8 @@ class NetworkCollection(Collection):
List networks. Similar to the ``docker networks ls`` command.
List networks. Similar to the ``docker networks ls`` command.
Args:
Args:
names (
list
): List of names to filter by.
names (
:py:class:`list`
): List of names to filter by.
ids (
list
): List of ids to filter by.
ids (
:py:class:`list`
): List of ids to filter by.
Returns:
Returns:
(list of :py:class:`Network`) The networks on the server.
(list of :py:class:`Network`) The networks on the server.
...
...
docker/models/services.py
Dosyayı görüntüle @
045bad2e
...
@@ -42,7 +42,7 @@ class Service(Model):
...
@@ -42,7 +42,7 @@ class Service(Model):
``label``, and ``desired-state``.
``label``, and ``desired-state``.
Returns:
Returns:
(
list
): List of task dictionaries.
(
:py:class:`list`
): List of task dictionaries.
Raises:
Raises:
:py:class:`docker.errors.APIError`
:py:class:`docker.errors.APIError`
...
@@ -92,29 +92,27 @@ class ServiceCollection(Collection):
...
@@ -92,29 +92,27 @@ class ServiceCollection(Collection):
args (list of str): Arguments to the command.
args (list of str): Arguments to the command.
constraints (list of str): Placement constraints.
constraints (list of str): Placement constraints.
container_labels (dict): Labels to apply to the container.
container_labels (dict): Labels to apply to the container.
endpoint_spec (
dict
): Properties that can be configured to
endpoint_spec (
EndpointSpec
): Properties that can be configured to
access and load balance a service. Default: ``None``.
access and load balance a service. Default: ``None``.
env (list of str): Environment variables, in the form
env (list of str): Environment variables, in the form
``KEY=val``.
``KEY=val``.
labels (dict): Labels to apply to the service.
labels (dict): Labels to apply to the service.
log_driver (str): Log driver to use for containers.
log_driver (str): Log driver to use for containers.
log_driver_options (dict): Log driver options.
log_driver_options (dict): Log driver options.
mode (str
ing
): Scheduling mode for the service (``replicated`` or
mode (str): Scheduling mode for the service (``replicated`` or
``global``). Defaults to ``replicated``.
``global``). Defaults to ``replicated``.
mounts (list of str): Mounts for the containers, in the form
mounts (list of str): Mounts for the containers, in the form
``source:target:options``, where options is either
``source:target:options``, where options is either
``ro`` or ``rw``.
``ro`` or ``rw``.
name (str): Name to give to the service.
name (str): Name to give to the service.
networks (list): List of network names or IDs to attach the
networks (list of str): List of network names or IDs to attach
service to. Default: ``None``.
the service to. Default: ``None``.
resources (dict): Resource limits and reservations. For the
resources (Resources): Resource limits and reservations.
format, see the Remote API documentation.
restart_policy (RestartPolicy): Restart policy for containers.
restart_policy (dict): Restart policy for containers. For the
format, see the Remote API documentation.
stop_grace_period (int): Amount of time to wait for
stop_grace_period (int): Amount of time to wait for
containers to terminate before forcefully killing them.
containers to terminate before forcefully killing them.
update_config (
dict): Specification for the update strategy of the
update_config (
UpdateConfig): Specification for the update strategy
service. Default: ``None``
of the
service. Default: ``None``
user (str): User to run commands as.
user (str): User to run commands as.
workdir (str): Working directory for commands to run.
workdir (str): Working directory for commands to run.
...
...
docker/types/networks.py
Dosyayı görüntüle @
045bad2e
...
@@ -48,7 +48,7 @@ class IPAMConfig(dict):
...
@@ -48,7 +48,7 @@ class IPAMConfig(dict):
Args:
Args:
driver (str): The IPAM driver to use. Defaults to ``default``.
driver (str): The IPAM driver to use. Defaults to ``default``.
pool_configs (
list
): A list of pool configurations
pool_configs (
:py:class:`list`
): A list of pool configurations
(:py:class:`~docker.types.IPAMPool`). Defaults to empty list.
(:py:class:`~docker.types.IPAMPool`). Defaults to empty list.
options (dict): Driver options as a key-value dictionary.
options (dict): Driver options as a key-value dictionary.
Defaults to `None`.
Defaults to `None`.
...
...
docker/types/services.py
Dosyayı görüntüle @
045bad2e
...
@@ -20,7 +20,7 @@ class TaskTemplate(dict):
...
@@ -20,7 +20,7 @@ class TaskTemplate(dict):
individual container created as part of the service.
individual container created as part of the service.
restart_policy (RestartPolicy): Specification for the restart policy
restart_policy (RestartPolicy): Specification for the restart policy
which applies to containers created as part of this service.
which applies to containers created as part of this service.
placement (
list
): A list of constraints.
placement (
:py:class:`list`
): A list of constraints.
"""
"""
def
__init__
(
self
,
container_spec
,
resources
=
None
,
restart_policy
=
None
,
def
__init__
(
self
,
container_spec
,
resources
=
None
,
restart_policy
=
None
,
placement
=
None
,
log_driver
=
None
):
placement
=
None
,
log_driver
=
None
):
...
@@ -62,13 +62,13 @@ class ContainerSpec(dict):
...
@@ -62,13 +62,13 @@ class ContainerSpec(dict):
image (string): The image name to use for the container.
image (string): The image name to use for the container.
command (string or list): The command to be run in the image.
command (string or list): The command to be run in the image.
args (
list
): Arguments to the command.
args (
:py:class:`list`
): Arguments to the command.
env (dict): Environment variables.
env (dict): Environment variables.
dir (string): The working directory for commands to run in.
dir (string): The working directory for commands to run in.
user (string): The user inside the container.
user (string): The user inside the container.
labels (dict): A map of labels to associate with the service.
labels (dict): A map of labels to associate with the service.
mounts (
list): A list of specifications for mounts to be added to
mounts (
:py:class:`list`): A list of specifications for mounts to be
containers created as part of the service. See the
added to
containers created as part of the service. See the
:py:class:`~docker.types.Mount` class for details.
:py:class:`~docker.types.Mount` class for details.
stop_grace_period (int): Amount of time to wait for the container to
stop_grace_period (int): Amount of time to wait for the container to
terminate before forcefully killing it.
terminate before forcefully killing it.
...
@@ -106,7 +106,7 @@ class ContainerSpec(dict):
...
@@ -106,7 +106,7 @@ class ContainerSpec(dict):
class
Mount
(
dict
):
class
Mount
(
dict
):
"""
"""
Describes a mounted folder's configuration inside a container. A list of
Describes a mounted folder's configuration inside a container. A list of
``Mount`
`s would be used as part of a
:py:class:`Mount
`s would be used as part of a
:py:class:`~docker.types.ContainerSpec`.
:py:class:`~docker.types.ContainerSpec`.
Args:
Args:
...
...
docs/api.rst
Dosyayı görüntüle @
045bad2e
...
@@ -19,8 +19,6 @@ Containers
...
@@ -19,8 +19,6 @@ Containers
:members:
:members:
:undoc-members:
:undoc-members:
.. py:module:: docker.api.image
Images
Images
------
------
...
...
docs/index.rst
Dosyayı görüntüle @
045bad2e
...
@@ -73,13 +73,12 @@ You can manage images:
...
@@ -73,13 +73,12 @@ You can manage images:
>>> client.images.list()
>>> client.images.list()
[<Image 'ubuntu'>, <Image 'nginx'>, ...]
[<Image 'ubuntu'>, <Image 'nginx'>, ...]
That's just a taste
r
of what you can do with the Docker SDK for Python. For more, :doc:`take a look at the reference <client>`.
That's just a taste of what you can do with the Docker SDK for Python. For more, :doc:`take a look at the reference <client>`.
.. toctree::
.. toctree::
:hidden:
:hidden:
:maxdepth: 2
:maxdepth: 2
Home <index>
client
client
containers
containers
images
images
...
...
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