I want to build docker image by ansible, but docker_image is deprecated module.
Can I be build in any way?
I couldn’t write english well, so this sentence is incorrect.
I want to build docker image by ansible, but docker_image is deprecated module.
Can I be build in any way?
I couldn’t write english well, so this sentence is incorrect.
Hi Shunsuke, that module can still be used despite being deprecated, it just may be removed at some point in the future. An alternative would be to simply use the command module to run the build command directly. At some point, the functionality to build images may be moved into the docker module itself, so this should be a short-term solution.
Thanks!
Just to see where this is at: I assume the docker_image module is still being rolled into the docker module? (http://docs.ansible.com/docker_module.html)
The ‘new’ canonical docker module is good, but doesn’t easily facilitate building images from a Dockerfile. You need to push to a Docker registry (Hub or private) first.
This certainly sucks if you’re on a slow connection (uploading even 80MB @ 70KB/s upload = 19 minutes)
Having Ansible build the image on the remote host (and handle passing files/scripts alongside the Dockerfile) to the docker build command running on the remote host is REALLY useful, and I’m hoping it doesn’t get lost in the move to the new module.
I’m going to keep using the docker_image module as much as I can but I still need to double-dip with the new module to run the containers/restart them/etc.