ERROR! Problem running vault password script /root/.vault_pass ([Errno 8] Exec format error). If this is not a script, remove the executable bit from the file

I got the following error when I ran an ansible script from a docker container. It looks like the executable bit needs to be reset. I am using docker for windows which is running on my windows 10 desktop. Could anyone help me with it ?

amazon-ebs: Running local shell script: /tmp/packer-shell828359150
amazon-ebs: [WARNING]: Error in vault password file loading (default): Problem running
amazon-ebs: vault password script /root/.vault_pass ([Errno 8] Exec format error). If this
amazon-ebs: is not a script, remove the executable bit from the file.
amazon-ebs: ERROR! Problem running vault password script /root/.vault_pass ([Errno 8] Exec format error). If this is not a script, remove the executable bit from the file.
==> amazon-ebs: Terminating the source AWS instance…
==> amazon-ebs: Cleaning up any extra volumes…
==> amazon-ebs: No volumes to clean up, skipping
==> amazon-ebs: Deleting temporary security group…
==> amazon-ebs: Deleting temporary keypair…

The error is pretty clear.

Vault files are either executable and expected to output the password upon execution, or they’re not executable and then ansible will use the file contents as the password.

You seem to have a vault file that contains the password but that also has the executable bit set for some reason.
You need to remove that so it’s not treated as an executable any more.

Dick