13 Dockerizing microservice APIs

 

This chapter covers

  • How to Dockerize an application
  • How to run Docker containers
  • How to run an application with Docker Compose
  • Publishing a Docker image to AWS Elastic Container Registry

Docker is a virtualization technology that allows us to run our applications anywhere by simply having a Docker execution runtime. Docker takes away the pain and effort required to tune and configure an environment to run code. It also makes deployments more predictable since it produces replicable artifacts (container images) that we can run locally as well as in the cloud.

In this chapter, you’ll learn to Dockerize a Python application. Dockerizing is the process of packaging an application as a Docker image. You can think of a Docker image as a build or artifact that is ready to be deployed and executed. To execute an image, Docker creates running instances of the image, known as containers. To deploy Docker images, we typically use a container orchestrator, such as Kubernetes, which takes care of managing the life cycle of a container. In the next chapter, you’ll learn to deploy Docker builds with Kubernetes. We’ll illustrate how to Dockerize an application using the orders service of the CoffeeMesh platform. You’ll also learn to publish your Docker builds to a container registry by uploading images to AWS’s Elastic Container Registry (ECR).

13.1 Setting up the environment for this chapter

13.2 Dockerizing a microservice

13.3 Running applications with Docker Compose

13.4 Publishing Docker builds to a container registry

Summary