IBM Support

SDK 1.10: Managing remote Containers using Docker Tooling plug-in

Technical Blog Post


Abstract

SDK 1.10: Managing remote Containers using Docker Tooling plug-in

Body

Roberto Guimarães Dutra de Oliveira - rdutra@br.ibm.com

Wainer dos Santos Moschetta - wainersm@br.ibm.com


 

The IBM SDK for Linux on Power (SDK) 1.10 provides a set of tools to manage Docker containers. Docker wraps a piece of software in a complete file system that contains everything needed to run: code, runtime, system tools, system libraries. In the SDK you can manage images and containers running in a remote server.

 

About this task
Configure and use the Docker Tooling plug-ins from the IBM SDK for Linux on Power running on your x86_64 machine to manage docker images and containers in the server-side (ppc64le). 

 

Installing and Configuring Docker
Before starting with the SDK plug-in, it is necessary to install the docker packages. 
  • On your laptop it requires docker and docker-machine command line tools.
  • On the remote host (ppc64le) it requires the docker engine. 

For more information about how to install  and configure docker access https://docs.docker.com/engine/installation/linux/

 

An installation example can be found bellow:
  • x86_64 Machine (Fedora 22):

$ sudo yum install docker

$ sudo curl -L https://github.com/docker/machine/releases/download/v0.8.2/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine 

$ sudo chmod +x /usr/local/bin/docker-machine

 

  • ppc64le machine (Ubuntu 16.04): 

$ sudo apt-get install docker.io

$ sudo usermod -aG docker <user_name>

$ sudo service docker start

 
NOTE: It is necessary to protect the docker rest API exposure via TSL (public/private authentication keys) and certificates. Setup instructions can be found here: https://docs.docker.com/engine/security/https

 

After creating the certificates, start docker daemon on the Ubuntu ppc64le machine using the following command:
$ sudo docker daemon --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem -H=0.0.0.0:2376

 

Managing Remote Images and Containers
Follow the steps described in this section to connect and manage remote images and containers
 
1. Open the Docker Perpective
  • In the SDK user interface select Windows > Perspective > Open Perspective > Other. 
  • Select "Docker Tooling" and press "OK".

 

2. Create a New Connection
  • In the "Docker Explorer" view click on the "Add Connection" Icon. 
  • Type the connection name.
  • Select the "Use custom connection settings" check box, select the "TCP connection" option and fill out the URI field. The URI should be in format: tcp://<hostname>:<port_number>.
  • You can use the "Test Connection" button to check if the docker connection to the remote machine is working correctly.
  • Press "Finish" button.
 
NOTE:  it is possible to expand the connection you just created and it get a list of all the available images and containers available int the remote machine.

 

image

Figure 1: Docker connection using TCP

 

3. Manage Images
You can manage the Docker images from "Docker Images" view. At the right corner of the view there are some buttons that allows to pull, push, build and delete images.

 

imageFigure 2: Docker images view

 

3.1 Pull an Image
Pulling a Docker image consists of requesting a repo tag or repository specification from a registry. The pull Wizard is used to specify the repository or repo:tag specification and the registry account to use. 
  • To pull an image, click on the Pull icon in "Docker Images" view.
  • Click in "Search" button and type the image name at search field.
  • Select an image from the list and click "Finish".
  • The pulling job will start. You can see the progress at the right bottom corner and depending on the image size and connection speed, it can take a while.

 

image

Figure 3: Pulling a docker image

 

3.2 Push an Image
Pushing a Docker image consists of specifying an existing repo tag to push. By default, Images will be pushed to the default Docker registry, but if a tag contains a registry specifier in addition to repo:tag, it will be pushed to the specified registry.
  • To push an image, click on the Push icon in "Docker Images" view.
  • Select the properly "Registry Account" and click "Finish".
  • The pushing job will start. You can see the progress at the right bottom corner and depending on the image size and connection speed, it can take a while.

imageFigure 4: Pushing a docker image

 

3.3 Build an Image
Building an image takes an existing image and modifies it to create a new image. The specification of the new Docker image is done via a special file which is always named: Dockerfile. 
  • To build a new image, click on the Build Image icon in "Docker Images" view.
  • Add the new image name. This name must follow correct repo:tag format.
  • Add the directory that contains or will contain the Dockerfile. Once a valid existing directory is specified, the "Edit" button will be enabled, allowing creation and modification of the Dockerfile using a basic editor dialog.
  • When the Dockerfile is considered complete, hitting the "Finish" button will start the image build action. When the build is complete, the "Docker Images" view will be refreshed automatically.

imageFigure 5: Building an image from a Dockerfile

 

4. Manage Containers
You can manage the Docker containers from the "Docker Containers" view. At the right corner of this view there are some buttons that allows you to start, stop, pause, resume, kill and delete containers.

 

imageFigure 6: Docker containers view

 

4.1 Create a Container
It allows to create a container based on an existing image.
  • To create a new container, move to "Docker Images" view.
  • Select an image from the list, right-click on it and select "run".
  • A wizard is showed and in the first page it allows a number of common settings like:
  • Name - Must be filled in as this is the name of the new image;
  • Entry point - Allows configuring the Container to run as an executable;
  • Command - The command to run in the Container when it starts.
  • You can click "Next" if you want to add extra configuration or just "Finish" to run the container.

image

Figure 7: Creating a container

 

4.2 Commit a Container
It allows to create a new image based on an existing container.
  • To commit a container, right-click on a container at "Docker Containers" view and select "Commit" option.
  • In the commit dialog enter the fields:
  • Name - name of the new image being created and must be a valid repo tag name.
  • Author - name to add as the author of the image (optional)
  • Comment - comment to add for the image (optional)
  • Press "Finish" and a new docker image will be created based on the selected container.

 

image

Figure 8: Commiting a container

 

5. More Information
For more information about Docker Tooling plug-in, access the documentation at: https://wiki.eclipse.org/Linux_Tools_Project/Docker_Tooling/User_Guide

 

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"HW1W1","label":"Power ->PowerLinux"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

UID

ibm16170067