diff options
author | Joffrey F <joffrey@docker.com> | 2019-01-09 14:38:53 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2019-01-09 14:45:13 -0800 |
commit | a579e9e20578ca9a074b28865ff594ed02fba6b3 (patch) | |
tree | 24165632ebfe3ca707e4675b0039d31ae3830aed /docker | |
parent | 1073b7364846709ad005e7991045d38365d911c9 (diff) | |
download | docker-py-proxy_env_fixes.tar.gz |
Remove use_config_proxy from exec. Add use_config_proxy docs to DockerClientproxy_env_fixes
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker')
-rw-r--r-- | docker/api/exec_api.py | 10 | ||||
-rw-r--r-- | docker/models/containers.py | 16 | ||||
-rw-r--r-- | docker/models/images.py | 4 |
3 files changed, 13 insertions, 17 deletions
diff --git a/docker/api/exec_api.py b/docker/api/exec_api.py index 830432a..d13b128 100644 --- a/docker/api/exec_api.py +++ b/docker/api/exec_api.py @@ -8,8 +8,7 @@ class ExecApiMixin(object): @utils.check_resource('container') def exec_create(self, container, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', - environment=None, workdir=None, detach_keys=None, - use_config_proxy=False): + environment=None, workdir=None, detach_keys=None): """ Sets up an exec instance in a running container. @@ -32,10 +31,6 @@ class ExecApiMixin(object): or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. ~/.docker/config.json is used by default. - use_config_proxy (bool): If ``True``, and if the docker client - configuration file (``~/.docker/config.json`` by default) - contains a proxy configuration, the corresponding environment - variables will be set in the container being created. Returns: (dict): A dictionary with an exec ``Id`` key. @@ -55,9 +50,6 @@ class ExecApiMixin(object): if isinstance(environment, dict): environment = utils.utils.format_environment(environment) - if use_config_proxy: - environment = \ - self._proxy_configs.inject_proxy_environment(environment) data = { 'Container': container, diff --git a/docker/models/containers.py b/docker/models/containers.py index 817d5db..10f667d 100644 --- a/docker/models/containers.py +++ b/docker/models/containers.py @@ -144,8 +144,7 @@ class Container(Model): def exec_run(self, cmd, stdout=True, stderr=True, stdin=False, tty=False, privileged=False, user='', detach=False, stream=False, - socket=False, environment=None, workdir=None, demux=False, - use_config_proxy=False): + socket=False, environment=None, workdir=None, demux=False): """ Run a command inside this container. Similar to ``docker exec``. @@ -168,10 +167,6 @@ class Container(Model): ``{"PASSWORD": "xxx"}``. workdir (str): Path to working directory for this exec session demux (bool): Return stdout and stderr separately - use_config_proxy (bool): If ``True``, and if the docker client - configuration file (``~/.docker/config.json`` by default) - contains a proxy configuration, the corresponding environment - variables will be set in the command's environment. Returns: (ExecResult): A tuple of (exit_code, output) @@ -190,7 +185,7 @@ class Container(Model): resp = self.client.api.exec_create( self.id, cmd, stdout=stdout, stderr=stderr, stdin=stdin, tty=tty, privileged=privileged, user=user, environment=environment, - workdir=workdir, use_config_proxy=use_config_proxy, + workdir=workdir, ) exec_output = self.client.api.exec_start( resp['Id'], detach=detach, tty=tty, stream=stream, socket=socket, @@ -682,6 +677,7 @@ class ContainerCollection(Collection): For example: ``{"Name": "on-failure", "MaximumRetryCount": 5}`` + runtime (str): Runtime to use with this container. security_opt (:py:class:`list`): A list of string values to customize labels for MLS systems, such as SELinux. shm_size (str or int): Size of /dev/shm (e.g. ``1G``). @@ -713,6 +709,10 @@ class ContainerCollection(Collection): tty (bool): Allocate a pseudo-TTY. ulimits (:py:class:`list`): Ulimits to set inside the container, as a list of :py:class:`docker.types.Ulimit` instances. + use_config_proxy (bool): If ``True``, and if the docker client + configuration file (``~/.docker/config.json`` by default) + contains a proxy configuration, the corresponding environment + variables will be set in the container being built. user (str or int): Username or UID to run commands as inside the container. userns_mode (str): Sets the user namespace mode for the container @@ -737,7 +737,6 @@ class ContainerCollection(Collection): volumes_from (:py:class:`list`): List of container names or IDs to get volumes from. working_dir (str): Path to the working directory. - runtime (str): Runtime to use with this container. Returns: The container logs, either ``STDOUT``, ``STDERR``, or both, @@ -952,6 +951,7 @@ RUN_CREATE_KWARGS = [ 'stdin_open', 'stop_signal', 'tty', + 'use_config_proxy', 'user', 'volume_driver', 'working_dir', diff --git a/docker/models/images.py b/docker/models/images.py index 30e86f1..af94520 100644 --- a/docker/models/images.py +++ b/docker/models/images.py @@ -258,6 +258,10 @@ class ImageCollection(Collection): platform (str): Platform in the format ``os[/arch[/variant]]``. isolation (str): Isolation technology used during build. Default: `None`. + use_config_proxy (bool): If ``True``, and if the docker client + configuration file (``~/.docker/config.json`` by default) + contains a proxy configuration, the corresponding environment + variables will be set in the container being built. Returns: (tuple): The first item is the :py:class:`Image` object for the |