Re. docker-dna and Michael's blog post - we started doing it like that for
the same sort of reasons you mention (being able to share playbooks between
provisioning "real" machines and buliding docker images), but then stopped
because it didn't work well with Docker's image caching stuff. The playbook
run ends up being a single layer in the image, so any change to the
playbook, however small, meant a full re-build of that layer (and any
subsequent ones). If you follow the "classic" Dockerfile usage, the steps
in your playbook would be broken out into separate RUN statements, so you
end up with finer-grained layers and therefore fewer rebuilt layers. (This
is obvious if you know how Docker works, but it took me a while to figure
out as I was learning Docker at the same time.)

That being said, I really did like having the ability to share playbooks.
And using Ansible (or Chef or whatever) to build a docker image makes
perfect sense - much less clunky than the current Dockerfile way. So if the
above isn't an issue for you then I would probably still go with it. My
real hope is that the Docker people somehow make it easier to use Ansible
etc. to build images, using image caching etc.

Hope that helps a bit!

Ben

On 19 September 2014 15:04, Toshio Kuratomi <[email protected]> wrote:

> Does this blog by Michael help you out?
> http://www.ansible.com/blog/2014/02/12/installing-and-building-docker-with-ansible
>
> It outlines a method of creating a docker image using ansible playbooks to
> define what they should look like.
>
> -Toshio
> On Sep 19, 2014 6:47 AM, "Justin Scott" <[email protected]> wrote:
>
>> Hey,
>>
>> We have a robust Ansible suite for deploying many of our servers and
>> we're running into trouble using Drone 
>> <https://github.com/drone/drone>because
>> of its use of Docker. Ansible has support for Docker insofar that it can
>> create and manage Docker images. However, this becomes a problem because
>> those are created from Dockerfiles that duplicate what we're already doing
>> with Ansible.
>>
>> For example, let's say we have an application server that we deploy the
>> application to and a build server that runs our CI. With something like
>> Jenkins we can just use the same Ansible role on both to get them ready for
>> the application. With Drone and Docker we need a base image of the server
>> that Drone can start fresh each time the tests run. That means we have both
>> an Ansible role and a Dockerfile that repeat how to create an application
>> server. We could potentially get the Ansible script to create that
>> Dockerfile through docker_image but we'd also have to update the Docker
>> registry and a bunch of overhead to keep both in sync.
>>
>> The obvious solution is just deploying entirely through Docker. While
>> possible, it will take a lot of time to port everything over to a new
>> architecture. There's also a very sneaky reference to docker-dna
>> <https://github.com/wrale/docker-dna> around 18:15 of the video at
>> http://www.ansible.com/docker <http://youtu.be/oZ45v8AeE7k?t=18m15s>. Is
>> that the best way to go about this? I'm surprised there's not more
>> discussion about this, it seems pretty clutch for Ansible users who want to
>> use Docker.
>>
>> Thanks,
>>    - Justin
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/19e09322-111c-4bbf-bcad-7c070dff9a02%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/19e09322-111c-4bbf-bcad-7c070dff9a02%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAG9juEr4rN_5qZ16MQTZYi%2BOikU8QWTJ58%3DO3XkpFwDg877w1w%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAG9juEr4rN_5qZ16MQTZYi%2BOikU8QWTJ58%3DO3XkpFwDg877w1w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CADVA9h83fzR%2BXv8iUfxXD5nGtm3SzD%2BWvwPW6z-U2TbyfhUAGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to