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

Jay Lau jay.lau.513 at gmail.com
Tue Aug 12 22:15:58 UTC 2014


Thanks Eric for the confirmation ;-)


2014-08-12 23:30 GMT+08:00 Eric Windisch <ewindisch at docker.com>:

>
>
>
> 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.
>
> --
> Regards,
> Eric Windisch
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 
Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140813/50606ca7/attachment.html>


More information about the OpenStack-dev mailing list