<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 12, 2014 at 5:53 AM, Jay Lau <span dir="ltr"><<a href="mailto:jay.lau.513@gmail.com" target="_blank">jay.lau.513@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I did not have the environment set up now, but by reviewing code, I think that the logic should be as following:<br>
</div>1) When using nova docker driver, we can use cloud-init or/and CMD in docker images to run post install scripts.<br>
myapp:<br>    Type: OS::Nova::Server<br>        Properties:<br>            flavor: m1.small<br>            image: my-app:latest 
      <<<<< docker image<br></div><div>            user-data: xxxx <<<<<<<<<<<<br>            <br></div>2) When using heat docker driver, we can only use CMD in docker image or heat template to run post install scripts.<br>

wordpress:<br>    type: DockerInc::Docker::Container<br>    depends_on: [database]<br>    properties:<br>      image: wordpress<br>      links:<br>        db: mysql<br>      port_bindings:<br>        80/tcp: [{"HostPort": "80"}]<br>

      docker_endpoint:<br>        str_replace:<br>          template: <a href="http://host:2345/" target="_blank">http://host:2345/</a><br>          params:<br>            host: {get_attr: [docker_host, networks, private, 0]}<br>
</div>            cmd: "/bin/bash" <<<<<<<</div></blockquote><div><br></div><div><br></div><div>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.</div>
<div><br></div><div>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.</div>
</div><div><br></div>-- <br><div dir="ltr">Regards,<div>Eric Windisch</div></div>
</div></div>