# 'force\_kill: true' option in docker\_container is unable to kill the container while killing it via the docker daemon (-f option) works fine

**URL:** <https://forum.ansible.com/t/force-kill-true-option-in-docker-container-is-unable-to-kill-the-container-while-killing-it-via-the-docker-daemon-f-option-works-fine/23995>\
**Category:** Ansible Project\
**Created:** [March 17, 2017, 10:25am UTC](https://forum.ansible.com/t/force-kill-true-option-in-docker-container-is-unable-to-kill-the-container-while-killing-it-via-the-docker-daemon-f-option-works-fine/23995 "2017-03-17T10:25:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ishan\_jain](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@ishan\_jain](https://forum.ansible.com/u/ishan_jain)\
**Post date:** [March 17, 2017, 10:25am UTC](https://forum.ansible.com/t/force-kill-true-option-in-docker-container-is-unable-to-kill-the-container-while-killing-it-via-the-docker-daemon-f-option-works-fine/23995/1 "2017-03-17T10:25:29Z")

</div>

I am having problems removing containers after introducing cadvisor - [https://github.com/google/cadvisor/issues/771](https://github.com/google/cadvisor/issues/771)

All my scripts that removes containers using Ansible docker\_container module (ansible 2.2.1.0) are now failing because of this. I have added force\_kill option, but it does not seems to be able to kill the containers, not at least in this situation.

- name: Delete docker containers  
docker\_container:  
name: “service1”  
force\_kill: true  
keep\_volumes: false  
state: absent

I am able to remove these containers via a plain simple docker command - docker stop and then docker rm service1 -fv

So my question is - what exactly is force\_kill doing and why is it not able to behave similar to docker daemon’s force kill option ?
