Over the past few years, Linux container technology has sparked a lot of interest in the IT world. And yes... you can use Linux containers on your IBM Power Systems running PowerVM as well! In this article, we will look at how you can get started with Docker running on an Ubuntu 16.04 ppc64le virtual machine on PowerVM. In future posts within this series, we will look at more complex container examples, as well as discussing some of the aspects of container management within the data center, so stay tuned!
Some Brief Container Background
While we won't go into all the deep technical details of how LinuX Containers (LXC) work (a simple pick-your-favorite-search-engine search will yield thousands of such articles), we wanted to highlight some of the key benefits that containers bring to the table. Containers are self-contained execution environments, each having their own CPU, memory, block IO and network resources that all share the same kernel of the host operating system. What you end up with is something that feels a lot like a virtual machine, but is much lighter weight, since you're only running a single operating system kernel. The containers are merely separate nimble processes, so they can be started and stopped almost instantaneously. This is great for application development and related environments where workloads may be spun up and spun down many times throughout the day. Linux containers can also run in a variety of execution environments, such as on bare metal or within virtual machines. In fact, the latter is one of the benefits of using containers on PowerVM--i.e., administrators can carve out (potentially large) container execution environments (read: virtual machines) and achieve a healthy balance between shared kernel execution environments, meeting SLAs via PowerVM's fine-grained resource controls and industry-leading resource isolation to address security concerns.
Why Docker?
The reality is that container technology is not a new concept; AIX WPARs and Solaris Zones are two examples of related technologies that have existed for years, so why has Docker received so much recent attention? Because it's accompanied by a highly active ecosystem! Docker has taken container technology to the next level by leveraging union file systems (UnionFS) that allow containers to be easily packaged into building blocks and versioned. These packages are called images and are defined by a construct called a Dockerfile. Furthermore, Docker has created an extremely vibrant ecosystem around these images via Docker Hub--a publicly accessible registry of images that anyone can download from or contribute to. For example, anyone can access Docker Hub and download images for everyday workloads like WordPress, MariaDB, Apache, etc. and spin up a container in a matter of seconds. It's due to this pervasiveness that Docker has become so widespread.
Let's Dig In!
In this example, we will get Docker installed on our Ubuntu virtual machine and showcase the classic "Hello World" container as a simple verification that Docker is installed and configured properly. To get started, provision an Ubuntu 16.04 ppc64le virtual machine (works on other flavors of Linux as well, albeit using slightly different commands) on PowerVM with network connectivity (so you can ssh to it) with 0.5 entitled processors and 4 GBs of memory; you can deploy this virtual machine via PowerVC or by using whatever other means you're familiar with.
Once that's done, let's get Docker installed and run the "Hello World" container as shown below:
(0) root @ docker-vm: /root
# uname -a
Linux docker-vm 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:05:18 UTC 2016 ppc64le ppc64le ppc64le GNU/Linux
(0) root @ docker-vm: /root
# sudo apt-get install docker.io
(0) root @ docker-vm: /root
# sudo docker pull ppc64le/hello-world
Using default tag: latest
latest: Pulling from ppc64le/hello-world
Digest: sha256:4145a08320bcfbc55c4005ddae4e4048af16f3abc754c721801ab88b53710033
Status: Downloaded newer image for ppc64le/hello-world:latest
(0) root @ docker-vm: /root
# sudo docker run ppc64le/hello-world
Hello from Docker on ppc64le!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
(0) root @ docker-vm: /root
Congratulations... you have just downloaded and run your first Docker container on PowerVM! In the next article of this series, we will move on to a more interesting example of deploying WordPress using
Docker Compose. Stay tuned for the next post to learn more!
And if you're already using container technology, we would love to hear about your use cases and how you see them fitting into your IT operations in the future; feel free to
drop me a note!
#Cloud#Containers#docker#Infra#powervc