Docker Machine is a very useful tool to set up a Docker environment on virtual machines (VMs). Using Docker Machine one can install the Docker engine on VMs, and manage the VMs with docker-machine commands. Docker Machine supports provisioning VMs with docker engine installed on different types of environment (eg. different cloud providers like AWS, GCP etc).

Described here is a way to use the Docker Machine tool to provision a Power (ppc64le) Docker environment on any Intel (x86_64) virtual machine, running either locally or in the cloud (AWS, GCP). Currently only Ubuntu 16.04 is supported as the host to run ppc64le docker machine.
Behind the scenes, we make use of qemu docker-machine driver plugin to provision the VM from a custom ppc64le ISO. The ppc64le VM runs on x86_64 by leveraging the full system emulation capability provided by Qemu TCG.

The following steps will guide you on installation and usage of the tool.

Note: This is an experimental software to solicit feedback. Do share your feedback and suggestions in the comments section.

Pre-requisites 
Intel Ubuntu 16.04 VM (min 2 vCPU, 4GB RAM, 20GB disk)

Setup
Run the following command on Intel Ubuntu 16.04 VM to setup the Power Docker environment.

$ wget http://ftp.unicamp.br/pub/ppc64el/boot2docker/install.sh && chmod +x ./install.sh && ./install.sh -s

The overall installation takes around 15-20 min, including the time spent in downloading the ISO image.

Exit the session and log in again to the Intel VM.

Run the following command to create the machine

$ docker-machine create -d qemu --qemu-boot2docker-url=/home/ubuntu/.docker/machine/boot2docker.iso --qemu-memory 2048 --qemu-cache-mode none --qemu-arch ppc64le vm1 

This should take around 4-5 min approximately.

Now you can use docker-machine commands to interact with the machine and start building and testing your docker images for Power.

If you are new to docker-machine here are some handy commands that will get you started.
 
1. List machines

$ docker-machine ls
NAME   ACTIVE   DRIVER   STATE     URL                                   SWARM   DOCKER        ERRORS
vm1    -        qemu     Running   tcp://192.168.42.157:2376                     v17.03.1-ce

 
2. List environment variables for a specific machine

 
$ docker-machine env vm1
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.42.157:2376"
export DOCKER_CERT_PATH="/home/ubuntu/.docker/machine/machines/vm1"
export DOCKER_MACHINE_NAME="vm1"
# Run this command to configure your shell:
# eval $(docker-machine env vm1)

 
3. Configure shell for enabling docker client to access a specific machine

$ eval $(docker-machine env vm1)

$ docker version
Client:
 Version:      17.05.0-ce-rc3
 API version:  1.27 (downgraded from 1.29)
 Go version:   go1.7.5
 Git commit:   90d35ab
 Built:        Tue May  2 17:48:51 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Fri Jun  2 17:34:21 2017
 OS/Arch:      linux/ppc64le
 Experimental: false

4. SSH to the machine

$ docker-machine ssh vm1

5. Run a ppc64le docker image

$ docker run -itd ppc64le/httpd

Since this is using emulation, performance is slower when compared to native execution. However, it should be able to give you an environment to build and verify a ppc64le docker image without depending on the availability of a native ppc64le environment.
We’ll continue to work on optimisation at various layers. Here are some test results on an EC2 c4.large system.

 
[Image is not on the local machine]
$ time docker run -itd ppc64le/httpd
Unable to find image 'ppc64le/httpd:latest' locally
latest: Pulling from ppc64le/httpd
f8bc5d41203b: Pull complete
42e24ec9ce9f: Pull complete
de8f8ee611b7: Pull complete
57f59a47bdd0: Pull complete
ca82b605e0a1: Pull complete
54dc6f8476af: Pull complete
cffdae079204: Pull complete
Digest: sha256:9f9a3bb3281e8817a1e4f380096db2c915b82a08db1a59fbc880d5c442a89dd3
Status: Downloaded newer image for ppc64le/httpd:latest
5c3683cca4961f73ab6024207ff754433867f282ff8237555dadb89b76b67602

real	2m3.447s
user	0m0.144s
sys	0m0.036s

[Image is already present on the local machine]
$ time docker run -itd ppc64le/httpd
8af864a083ed5f6b2c064c2407e4ae6fbe8bc84702d44a4e4cea4185e02e5e3b

real	0m2.233s
user	0m0.036s
sys	0m0.016s

 
In the end a special mention for Basava, Bharata, Manjunath and Nikunj whose efforts made this possible.

1 comment on"Provisioning PPC64LE Docker-Machine on Intel"

  1. […] [Note – The docker-machine contents first appeared here ] […]

Join The Discussion

Your email address will not be published. Required fields are marked *