[openstack-dev] [kolla] Build the docker images in a graceful way
zhang.lei.fly at gmail.com
Wed Jun 29 12:50:28 UTC 2016
Recently, Ansible release 2.1 version with lots of new feature. One of the
is the management for docker.
Redhat also announced the Ansible Container project, which can build
docker images by using
Ansible Playbooks. No more write the ugly Dockerfile script. I think this
will be more graceful.
Here the explanation that why not use Dockerfile from ansible-container
A Dockerfile is not much more than a script with hand-crafted shell
commands. We're well past the
point where we should be managing build processes with manually maintained
series of shell scripts.
That's why we wrote Ansible in the first place, and this is just as
applicable to containers.
Ansible Container permits orchestration even during the build process,
whereas docker build does
not. For example, in a Django project, your VCS may contain a bunch of
sources for static assets
that need to be compiled and then collected. With Ansible Container, you
can compile the static
assets in your Django container and then collect them into your static file
Many people use Docker for development environments only but then use
Ansible playbooks to push
out to staging or production. This allows you to use the same playbooks and
roles in your Docker
dev environment as in your production environments.
Ansible Container does all of this without installing SSH, leaving Ansible
artifacts on your
built images, or having excess layers to the union filesystem.
I also pushed a PS to implement almost the same thing for Kolla.
There many benefit for this.
1. more easy to understand. The original base/Dockerfile is too long,
mixed with different base image logical
and different install type. Whereas in the new implement, it is more
clearly. it is split into multi
2. easy to extend. We can reuse the role concept for the Ansible. For
example, when you want to extend
the neutron-server container. You can write your own roles, like
neutron-server-lbaas role, and just
add this to the neutron-server playbooks. In this way, we can implement
the customize issue. ( this will
3. It is also possible to change the exist data. For example, i want to
change the repo url to a internal
The user can provide a ansible variables file, which hold the new repo url
and overwrite the
This PS is in POC stage. Post this mail to gather any advise and better
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev