# docker\_container recreate doesn't seem to work

**URL:** <https://forum.ansible.com/t/docker-container-recreate-doesnt-seem-to-work/23856>\
**Category:** Ansible Project\
**Created:** [March 1, 2017, 10:02pm UTC](https://forum.ansible.com/t/docker-container-recreate-doesnt-seem-to-work/23856 "2017-03-01T22:02:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartinBBG](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@MartinBBG](https://forum.ansible.com/u/MartinBBG)\
**Post date:** [March 1, 2017, 10:02pm UTC](https://forum.ansible.com/t/docker-container-recreate-doesnt-seem-to-work/23856/1 "2017-03-01T22:02:56Z")

</div>

I have an docker\_container that creates a container with state started (lets called this docker container Service). It has a volume\_from another container (lets call that container Volume). When the Volume container changes to a new image, we need to recreate the Service container.

In ansible, I am trying to create a handler that simply has this:

- name: restart Service  
docker\_container:  
name: Service  
recreate: yes  
state: started

When I run ansible, I get:

…

“user”: null,  
“uts”: null,  
“volume\_driver”: null,  
“volumes”: null,  
“volumes\_from”: null  
},  
“module\_name”: “docker\_container”  
},  
“msg”: “Error creating container: 400 Client Error: Bad Request ("{"message":"No command specified"}")”

Notice the volumes\_from is null and so are all the other settings. Seeing this, I tried copying the example in the ansible docker\_container docs, and I respecified ALL the options that we have in the task that initially creates the docker container. And it does the exact same thing.

Is there a trick to setting up a task handler that simply recreates the docker container?

Thanks.
