[openstack-dev] [OpenStack][Docker][HEAT] Cloud-init and docker container

Eric Windisch ewindisch at docker.com
Tue Aug 12 15:30:46 UTC 2014

On Tue, Aug 12, 2014 at 5:53 AM, Jay Lau <jay.lau.513 at gmail.com> wrote:

> I did not have the environment set up now, but by reviewing code, I think
> that the logic should be as following:
> 1) When using nova docker driver, we can use cloud-init or/and CMD in
> docker images to run post install scripts.
> myapp:
>     Type: OS::Nova::Server
>         Properties:
>             flavor: m1.small
>             image: my-app:latest  <<<<< docker image
>             user-data: xxxx <<<<<<<<<<<
> 2) When using heat docker driver, we can only use CMD in docker image or
> heat template to run post install scripts.
> wordpress:
>     type: DockerInc::Docker::Container
>     depends_on: [database]
>     properties:
>       image: wordpress
>       links:
>         db: mysql
>       port_bindings:
>         80/tcp: [{"HostPort": "80"}]
>       docker_endpoint:
>         str_replace:
>           template: http://host:2345/
>           params:
>             host: {get_attr: [docker_host, networks, private, 0]}
>             cmd: "/bin/bash" <<<<<<<

I can confirm this is correct for both use-cases. Currently, using Nova,
one may only specify the CMD in the image itself, or as glance metadata.
The cloud metadata service should be assessable and usable from Docker.

The Heat plugin allow settings the CMD as a resource property. The
user-data is only passed to the instance that runs Docker, not the
containers. Configuring the CMD and/or environment variables for the
container is the correct approach.

Eric Windisch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140812/0795cb6f/attachment.html>

More information about the OpenStack-dev mailing list