Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion samcli/local/docker/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def create(self):
}
},
# We are not running an interactive shell here.
"tty": False
"tty": False,
# Set proxy configuration from global Docker config file
"use_config_proxy": True
}

if self._container_opts:
Expand Down
2 changes: 1 addition & 1 deletion samcli/local/docker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""

import os
import posixpath
import re
import posixpath
try:
import pathlib
except ImportError:
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/local/docker/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def test_must_create_container_with_required_values(self):
command=self.cmd,
working_dir=self.working_dir,
volumes=expected_volumes,
tty=False)
tty=False,
use_config_proxy=True)
self.mock_docker_client.networks.get.assert_not_called()

def test_must_create_container_including_all_optional_values(self):
Expand Down Expand Up @@ -141,6 +142,7 @@ def test_must_create_container_including_all_optional_values(self):
working_dir=self.working_dir,
volumes=expected_volumes,
tty=False,
use_config_proxy=True,
environment=self.env_vars,
ports=self.exposed_ports,
entrypoint=self.entrypoint,
Expand Down Expand Up @@ -206,6 +208,7 @@ def test_must_create_container_translate_volume_path(self, os_mock):
working_dir=self.working_dir,
volumes=translated_volumes,
tty=False,
use_config_proxy=True,
environment=self.env_vars,
ports=self.exposed_ports,
entrypoint=self.entrypoint,
Expand Down Expand Up @@ -250,6 +253,7 @@ def test_must_connect_to_network_on_create(self):
command=self.cmd,
working_dir=self.working_dir,
tty=False,
use_config_proxy=True,
volumes=expected_volumes
)

Expand Down Expand Up @@ -292,6 +296,7 @@ def test_must_connect_to_host_network_on_create(self):
command=self.cmd,
working_dir=self.working_dir,
tty=False,
use_config_proxy=True,
volumes=expected_volumes,
network_mode='host'
)
Expand Down