Ansible - Resolve "CRITICAL Failed to find driver docker"

by
Jeremy Canfield |
Updated: April 04 2025
| Ansible articles
Let's say something like this is being returned when using the molecule CLI.
]$ molecule test
CRITICAL Failed to find driver docker. Please ensure that the driver is correctly installed.
The molecule drivers command can be used to determine if you have the driver installed. In this example, the docker driver is not listed.
]$ molecule drivers
default
And the pip list command can be used to see that the molecule package is installed but the TBD package is NOT installed.
]$ pip list
Package Version
------------------------- ---------
ansible-compat 25.1.5
ansible-core 2.18.4
attrs 25.3.0
bracex 2.5.post1
cffi 1.17.1
click 8.1.8
click-help-colors 0.9.4
cryptography 44.0.2
enrich 1.2.7
Jinja2 3.1.6
jsonschema 4.23.0
jsonschema-specifications 2024.10.1
markdown-it-py 3.0.0
MarkupSafe 3.0.2
mdurl 0.1.2
molecule 25.4.0
packaging 24.2
pip 25.0.1
pluggy 1.5.0
pycparser 2.22
Pygments 2.19.1
PyYAML 6.0.2
referencing 0.36.2
resolvelib 1.0.1
rich 14.0.0
rpds-py 0.24.0
subprocess-tee 0.4.2
typing_extensions 4.13.1
wcmatch 10.0
Let's install the docker plugin.
pip install molecule-plugins[docker]
And now pip should install molecule-plugins and docker.
]$ pip list
Package Version
------------------------- ---------
ansible-compat 25.1.5
ansible-core 2.18.4
attrs 25.3.0
bracex 2.5.post1
certifi 2025.1.31
cffi 1.17.1
charset-normalizer 3.4.1
click 8.1.8
click-help-colors 0.9.4
cryptography 44.0.2
distro 1.9.0
docker 7.1.0
enrich 1.2.7
idna 3.10
Jinja2 3.1.6
jsonschema 4.23.0
jsonschema-specifications 2024.10.1
markdown-it-py 3.0.0
MarkupSafe 3.0.2
mdurl 0.1.2
molecule 25.4.0
molecule-plugins 23.7.0
packaging 24.2
pip 25.0.1
pluggy 1.5.0
pycparser 2.22
Pygments 2.19.1
PyYAML 6.0.2
referencing 0.36.2
requests 2.32.3
resolvelib 1.0.1
rich 14.0.0
rpds-py 0.24.0
selinux 0.3.0
subprocess-tee 0.4.2
typing_extensions 4.13.1
urllib3 2.3.0
wcmatch 10.0
And the molecule plugins should include docker and probably other plugins too.
]$ molecule drivers
openstack
gce
azure
default
ec2
containers
docker
podman
vagrant
Did you find this article helpful?
If so, consider buying me a coffee over at