3 Hanging some flesh on the task skeleton

 

This chapter covers

  • Reviewing how to start and stop Docker containers via the command line
  • Introducing the Docker API calls for starting and stopping containers
  • Implementing the Task concept to start and stop a container

Think about cooking your favorite meal. Let’s say you like making homemade pizza. To end up pulling a delicious, hot pizza out of your oven, you have to perform a number of tasks. If you like onions, green peppers, or any other veggies on your pizza, you have to cut them up. You must knead the dough and spread it on a baking sheet. Next, you spread tomato sauce across the dough and sprinkle cheese over it. Finally, on top of the cheese, you layer your veggies and other ingredients.

A task in an orchestration system is similar to one of the individual steps in making a pizza. Like most companies these days, yours most likely has a website. That company’s website runs on a web server, perhaps the ubiquitous Apache web server. That’s a task. The website may use a database, like MySQL or PostgreSQL, to store dynamic content. That’s a task.

In our pizza-making analogy, the pizza wasn’t made in a vacuum. It was created in a specific context, which is a kitchen. The kitchen provides the necessary resources to make the pizza: a refrigerator where the cheese is stored, cabinets where the pizza sauce is kept, an oven in which to cook the pizza, and a knife to cut the pizza into slices.

3.1 Docker: Starting, stopping, and inspecting containers from the command line

3.2 Docker: Starting, stopping, and inspecting containers from the API

3.3 Task configuration

3.4 Starting and stopping tasks

Summary

sitemap