How to create a Dockerized Application for Ubuntu on Power (ppc64) Servers

This article should help you to create a dockerized application on IBM Power processor based servers . I’ll be taking WordPress as an example application and show you how to dockerize it on Power servers. The process is very similar to how one would do on an Ubuntu server running on Intel servers.

For this howto, I have used an Ubuntu VM running on PowerKVM servers, provisioned via SiteOx (http://www.siteox.com/index.php).

For installing and running docker on Ubuntu for IBM Power system, please refer to my previous article on the same topic.

Preparation

#Create a base Ubuntu image for docker wordpress container

Base docker image for wordpress requires access to both main and universe repos.

rdlrdp@sovmp154:~$ sudo debootstrap --components=main,universe utopic utopic
rdlrdp@sovmp154:~$ sudo tar -C utopic -c . | sudo docker import - local:utopic

Multi-arch support for docker hub is still not there, so you will need to either use a local or private repository for hosting your images for Power architecture or name the image explicitly with an arch prefix (like user/ubuntu_ppc64le) in docker hub.

Setup

#Clone wordpress recipe from github to quickly setup a wordpress docker image

rdlrdp@sovmp154:~$ git clone https://github.com/bpradipt/docker-wordpress.git

This will clone the relevant code including Dockerfile in docker-wordpress directory. Edit the Dockerfile as per your requirement.

#Build docker wordpress image

Change directory to docker-wordpress and build the docker image

rdlrdp@sovmp154:~/docker-wordpress$ sudo docker build --force-rm=true -t pradipta/wordpress .

List the created docker image

rdlrdp@sovmp154:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
pradipta/wordpress latest 4faa3f28f04a 9 minutes ago 649.3 MB
local utopic 422173381b35 21 minutes ago 280.5 MB

Running

#Run docker wordpress container

rdlrdp@sovmp154:~/docker-wordpress$ sudo docker run --name wordpress -d -p 8080:80 pradipta/wordpress
88f44b1f4ec68560ee0bdf07e99cd588e24a41b854e367b67a23335a00c26eb7

#Check whether docker container is running or not

rdlrdp@sovmp154:~$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
88f44b1f4ec6 pradipta/wordpress:latest "/bin/bash /start.sh 22 minutes ago Up 22 minutes 0.0.0.0:8080->80/tcp wordpress

WordPress docker container is running locally and listening on port 8080.

Making the Dockerized Application accessible publicly (optional)

If you are running behind a firewall and want to enable public availability of the service then you need to follow these steps.

For eg, my SiteOx VM is behind a firewall and accessible only via SSH. So I need some way to expose the service publicly. One very simple option is to use pagekite – https://pagekite.net/

I’ll show you how to use pagekite to enable public access to your dockerized application. Please go through security implications and related details available in the pagekit site before using.

#Install and configure pagekite

Its a breeze to install and configure pagekite.

From pagekite site –

In a console, run:
$ curl -s https://pagekite.net/pk/ | sudo bash
$ pagekite.py 80 yourname.pagekite.me

On my Ubuntu VM this is what I did

rdlrdp@sovmp154:~$ curl -s https://pagekite.net/pk/ |sudo bash
rdlrdp@sovmp154:~$ pagekite.py --insecure 8080 pradipta.pagekite.me

dockerized_wordpress

# Accessing the wordpress docker container from an external machine and configure wordpress

Using my laptop I configured the dockerized wordpress application running on my Ubuntu for Power VM.

I pointed my browser to http:/pradipta.pagekite.me and it took me straight to the wordpress configuration steps. On completing the configuration, wordpress dashboard gets displayed.

dockerized_wordpress_3

Pradipta Kumar Banerjee

I'm a Cloud and Linux/ OpenSource enthusiast, with 16 years of industry experience at IBM. You can find more details about me here - Linkedin

You may also like...