UP | HOME
../../

Cloud Computing: Lab on Docker

Table of Contents

1 Abstract

This lab describes four tasks to carry out using Docker. The lab expects the students to have read the background materials, and to be able to supply details.

2 Objectives

Be able to

  1. describe what Docker does.
  2. exercise at least 10 of the Docker commands
  3. write a Dockerfile and build a Docker image
  4. interconnect two dockers

3 Background

  1. What are containers? ./containers.html
  2. What is a Docker container? ./docker-what.html
  3. How does a Docker container run? ./docker-how.html

4 Lab Experiment

In all of these taks, "performance" measurement is expected. Copy and paste relevant text from the "work windows" into your myLabJournal.txt and later into L3Report.pdf.

4.1 Task 1: Docker Usage

Get yourself a free account on http://www.katacoda.com/courses/docker. This site features an interactive "Learn Docker and Containers" course by Ben Hall. (Open Source??) "Understand real world patterns and approaches in a live [Docker] environment without any downloads or configuration". It has 10+ scenarios, and a Playground aimed at learning by doing. Choose the scenarios that appeal to you to accomplish the following goals.

  1. Exercise at least 10 of the Docker commands.
  2. Run two or more images that you downloaded from the std Docker repo. Your choice: tiny .. large.
  3. Demonstrate that you understand namespaces (through the output of some of these commands).
  4. Demonstrate that you understand cgroups (through the output of some of these commands).

4.2 Task 2: Build a Docker container image

  1. Use the Playground of the above site. Or, use pmcluster. Or, your own machine.
  2. Build a Docker container image. Of a "useful", not too tiny, software. Include the Dockerfile in the turnin bundle. (If you are stuck at what to build, consider httpd, new/fancy text editors such as sublime.) The Dockerfile need not be entirely your original, but it should have tweaks that you made.

4.3 Task 3: Communicating Between Containers

  1. Set up two dockers, one a producer and the other a consumer.
  2. Set the Producer up as a Compilation Engine generating assembly language files from C language source code files using Map/Hadoop.
  3. Set the Consumer as an Assembler Engine that assembles these files, also using the Map/Hadoop, into *.o files.
  4. We are not considering the link(er)(ing) and further build tasks.
  5. It is worth watching "Building Software at Google Scale" video https://www.youtube.com/watch?v=2qv3fcXW1mg 2012 to get a perspective.
  6. Choose a collection of source code files (> 20) that do not have compilation errors. E.g., the Linux kernel (http://kernel.org).
  7. Use the compilers/assemblers of the host OS.

4.4 Task 4: Experiment with RancherOS

  1. http://rancher.com/rancher-os/ "RancherOS is a 20mb Linux distro that runs the entire OS as Docker containers."
  2. Run RancherOS on VMware or VirtualBox. Login as user: rancher, password rancher Then sudo su will give you root access.
  3. Run a web server image chosen from the Docker repository.

4.5 Task 5 (Bonus) : Run Producers and Consumers on Multiple Machines

  1. Combine the overall effects of Tasks 3 and 4.
  2. Use pmcluster, or AWS, or Azure

4.6 Task 6 (Bonus) : Run modret.c in a Linux distro of 2008

You are given the source code of modret.c. (If you wish, read the context of this little program in Buffer Overflow alephOne.) This tiny program illustrates how one can change the return address on the stack. However, modern distributions have stack protection measures, such as canaries. So, rather than disable these protections, we could run it in an old distro such as Backtrack Auditor of 2005. This ISO can be web-searched, but here is a local copy: auditor-250405-01.iso.

  1. Do this first in VirtualBox, booting from this ISO.
  2. Auditor distro, in its time, was a full distro intended for penetration testing. So, it has considerable excess baggage. Construct a minimal Docker image so that modret.c could be compiled, linked, and executed.

4.7 Survey

  1. Your level of interest in this lab exercise (high, average, low);
  2. How challenging is this lab exercise? (high, average, low);
  3. How valuable is this lab as a part of the course (high, average, low).
  4. Are the supporting materials and lectures helpful for you to finish the project? (very helpful, somewhat helpful, not helpful);
  5. How useful was this task to your understanding of Hadoop?
  6. How many hours (approximately) did you spend on Task 1? 2? 3? 4?
  7. Do you feel confident on applying the skills learned in the lab to solve other problems with Docker? (low, average, high)

4.8 Turn In

  1. We are replacing answers.txt with L3Report.pdf. This should be written as a tech report. Devote one section each for the above tasks. Use your judgement in what to include in these sections. Your overall goal is to convince any reader of your report that you have understood and carried out the tasks.
  2. ~ceg738000/turnin L3 ReadMe.txt myLabJournal.txt L3Report.pdf survey.txt

Grading Sheet

5 References


Copyright © 2015 pmateti@wright.edu www.wright.edu/~pmateti 2015-10-05