How to build docker image?

140 views
Skip to first unread message

Shunsuke Mie

unread,
Dec 11, 2014, 5:59:58 PM12/11/14
to ansible...@googlegroups.com
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.

James Cammarata

unread,
Dec 11, 2014, 11:20:26 PM12/11/14
to ansible...@googlegroups.com
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!

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4af0983f-94c0-401b-9007-6ea267a0a3b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Silverlock

unread,
Apr 24, 2015, 9:43:00 PM4/24/15
to ansible...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages