Ask Your Question
1

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

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

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: https://get.docker.io/ 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
5

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

larsks gravatar image

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

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

I downloaded the script to a local file:

curl -o install-docker.sh http://get.docker.io/

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

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

And assigned a floating ip:

nova floating-ip-assocaite docker0 192.168.200.6

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

ssh ubuntu@192.168.200.6

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

Comments

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 -0600 )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 -0600 )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

Stats

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

Seen: 951 times

Last updated: Jun 27 '14