Ask Your Question

How do I install docker on my instances during boot time?S

asked 2014-06-26 12:25:29 -0500

lester gravatar image

See I've used Amazon EC2 before and there they have this thing called user data that allows cloud-init on ubuntu instances to install packages during boot time. From my understanding this is similar to customization script in Openstack. From that I figured the script I use for installing docker in EC2 should work for Openstack as well. This script: but it doesn't. Are there scripts out there specifically for Openstack instances that installs docker?

My scripting ability is very limited so I'm not sure what is going wrong here.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-06-26 13:04:31 -0500

larsks gravatar image

updated 2014-06-27 08:16:18 -0500

Assuming that you are booting a cloud-init enabled image, such as this one , the script at should work just as well in your OpenStack environment as it does in EC2.

I downloaded the script to a local file:

curl -o

And then booted an instance using this script as the user-data:

nova boot --user-data --flavor m1.small -image ubuntu-trusy-amd64 --key-name mykey docker0

And assigned a floating ip:

nova floating-ip-assocaite docker0

Once this system booted up I was able to log in using my key:

ssh ubuntu@

And running ps showed that the script was running:

# ps -fe | grep apt-get
root      1349  1347  3 17:59 ?        00:00:01 apt-get install -y -q linux-image-extra-3.13.0-24-generic

Once the script finished running, I had docker available:

# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
busybox             latest              a9eb17255234        3 weeks ago         2.433 MB

Everything seems to work as intended.

edit flag offensive delete link more


Ok this is great. @lester, it should work in your setup and let me know the result.

SGPJ gravatar imageSGPJ ( 2014-06-26 13:06:46 -0500 )edit

Awesome thank you very much! it worked!

I was also able to just put #include https://get.docker on the customization script. It turns out it takes about 10-12 mins about booting before I can see it finish install. Thank you so much!

lester gravatar imagelester ( 2014-06-26 14:01:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2014-06-26 12:25:29 -0500

Seen: 922 times

Last updated: Jun 27 '14