Some minor cleanup from yelp/fig
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
This commit is contained in:
parent
c0123c7477
commit
3c0f297ba6
5 changed files with 42 additions and 12 deletions
|
|
@ -31,4 +31,5 @@ def docker_client():
|
|||
ca_cert=ca_cert,
|
||||
)
|
||||
|
||||
return Client(base_url=base_url, tls=tls_config, version='1.14')
|
||||
timeout = int(os.environ.get('DOCKER_CLIENT_TIMEOUT', 60))
|
||||
return Client(base_url=base_url, tls=tls_config, version='1.14', timeout=timeout)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,30 @@ from .progress_stream import stream_output, StreamOutputError
|
|||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
DOCKER_CONFIG_KEYS = ['image', 'command', 'hostname', 'domainname', 'user', 'detach', 'stdin_open', 'tty', 'mem_limit', 'ports', 'environment', 'env_file', 'dns', 'volumes', 'entrypoint', 'privileged', 'volumes_from', 'net', 'working_dir', 'restart', 'cap_add', 'cap_drop']
|
||||
DOCKER_CONFIG_KEYS = [
|
||||
'cap_add',
|
||||
'cap_drop',
|
||||
'command',
|
||||
'detach',
|
||||
'dns',
|
||||
'domainname',
|
||||
'entrypoint',
|
||||
'env_file',
|
||||
'environment',
|
||||
'hostname',
|
||||
'image',
|
||||
'mem_limit',
|
||||
'net',
|
||||
'ports',
|
||||
'privileged',
|
||||
'restart',
|
||||
'stdin_open',
|
||||
'tty',
|
||||
'user',
|
||||
'volumes',
|
||||
'volumes_from',
|
||||
'working_dir',
|
||||
]
|
||||
DOCKER_CONFIG_HINTS = {
|
||||
'link' : 'links',
|
||||
'port' : 'ports',
|
||||
|
|
@ -337,7 +360,9 @@ class Service(object):
|
|||
return volumes_from
|
||||
|
||||
def _get_container_create_options(self, override_options, one_off=False):
|
||||
container_options = dict((k, self.options[k]) for k in DOCKER_CONFIG_KEYS if k in self.options)
|
||||
container_options = dict(
|
||||
(k, self.options[k])
|
||||
for k in DOCKER_CONFIG_KEYS if k in self.options)
|
||||
container_options.update(override_options)
|
||||
|
||||
container_options['name'] = self._next_container_name(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue