mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Don't pass volumes_from to create_container
Don't pass the volumes_from argument to the Docker create_container method. If the volumes_from argument is passed to the create_container method, Docker raises the following exception: docker.errors.DockerException: 'volumes_from' parameter has no effect on create_container(). It has been moved to start()
This commit is contained in:
parent
264a16d822
commit
09e10ea031
1 changed files with 6 additions and 0 deletions
|
@ -750,6 +750,7 @@ class DockerManager(object):
|
|||
'stdin_open': self.module.params.get('stdin_open'),
|
||||
'tty': self.module.params.get('tty'),
|
||||
'volumes_from': self.module.params.get('volumes_from'),
|
||||
'dns': self.module.params.get('dns'),
|
||||
}
|
||||
if docker.utils.compare_version('1.10', self.client.version()['ApiVersion']) >= 0:
|
||||
params['volumes_from'] = ""
|
||||
|
@ -757,6 +758,11 @@ class DockerManager(object):
|
|||
if params['volumes_from'] is not None:
|
||||
self.ensure_capability('volumes_from')
|
||||
|
||||
extra_params = {}
|
||||
if self.module.params.get('insecure_registry'):
|
||||
if self.ensure_capability('insecure_registry', fail=False):
|
||||
extra_params['insecure_registry'] = self.module.params.get('insecure_registry')
|
||||
|
||||
def do_create(count, params):
|
||||
results = []
|
||||
for _ in range(count):
|
||||
|
|
Loading…
Reference in a new issue