DevOps Zone is brought to you in partnership with:

Software developer and architect with over 10 years experience. Diarmuid is a DZone MVB and is not an employee of DZone and has posted 2 posts at DZone. You can read more from them at their website. View Full User Profile

Docker.io and Redis on DigitalOcean in Five Minutes

09.03.2013
| 3356 views |
  • submit to reddit

It all started when I casually spotted a sponsored tweet offering me $10 worth of virtual computing power from DigitalOcean. I had seen their ads on everything from Facebook to Gmail and thought I’d check out what the fuss was about.

I had been planning to try Docker.io on something other than my MacBook for a while and was tempted to run up another Linode server. Instead, I decided to see if I could get Docker running on DigitalOcean.

Docker turned 0.6 over the weekend and is heading full speed toward a production-grade container platform. If you are reading this post you are probably already interested in Docker, but for the uninitiated, Docker allows you to ship applications as containers running in what appears to be self-contained Linux environments. It's is based on Linux container magic and runs within the same operating system as its host.

So here is my guide to get Docker 0.6.1 running on the DigitalOcean VM. Five minutes starts now!

First, create a new droplet based upon the Ubuntu 13.04 x64 image

ImageCreate the droplet and within a minute or so you should be able to interact with your new machine. Your root password is emailed to the registered email address

Once it is created, SSH directly on to the box as root. For me it was as simple as:

 ssh root@192.241.174.17

Now, following Docker’s install guide, I ran:

apt-get update
apt-get install linux-image-extra-`uname -r`

sh -c "curl http://get.docker.io/gpg | apt-key add -"

sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

apt-get update
apt-get install lxc-docker

Which allowed me to run Docker for the first time.

root@blog:~# docker version
Client version: 0.6.1
Server version: 0.6.1
Git commit: 5105263
Go version: go1.1.2
Last stable version: 0.6.1

Now, to run something exciting, let's run Redis.

docker run -d johncosta/redis 

Install redis-cli on the host machine.

apt-get install redis-server

redis-cli -h 192.241.174.17 -p 6379

Or connect from your MacBook.

brew install redis

redis-cli -h 192.241.174.17 -p 6379

Now, it's time to play with Redis.

redis localhost:6379> set docker magic
OK
redis localhost:6379> get docker
"magic" 

Five minutes must be up by now!



Published at DZone with permission of Diarmuid Moloney, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)