[2.6] docker_container: fix working_dir (#44522)

* docker_container: fix working_dir (#42857)

WorkingDir should be read from Config instead of HostConfig, check
https://docs.docker.com/engine/api/v1.37/#operation/ContainerInspect

* Adding changelog entry.
This commit is contained in:
Felix Fontein 2018-09-05 06:21:36 +02:00 committed by Matt Clay
parent 04296f4230
commit 55dbf27362
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "docker_container: fixing ``working_dir`` idempotency problem (https://github.com/ansible/ansible/pull/42857)"

View file

@ -1292,7 +1292,7 @@ class Container(DockerBaseClass):
expected_volumes=config.get('Volumes'),
expected_binds=host_config.get('Binds'),
volumes_from=host_config.get('VolumesFrom'),
working_dir=host_config.get('WorkingDir')
working_dir=config.get('WorkingDir')
)
if self.parameters.restart_policy:
config_mapping['restart_retries'] = restart_policy.get('MaximumRetryCount')