4 Welcome to Docker

 

This chapter covers

  • Understanding the importance of containers
  • Recognizing how containers fit into a microservices architecture
  • Understanding the differences between a VM and a container
  • Using Docker and its main components
  • Integrating Docker with microservices

To continue successfully building our microservices, we need to address the portability issue: how are we going to execute our microservices in different technology locations? Portability is the ability to use or move software to different environments.

In recent years, the concept of containers has gained more and more popularity, going from a “nice-to-have” to a “must-have” in software architecture. The use of containers is an agile and useful way to migrate and execute any software development from one platform to another (for example, from the developer’s machine to a physical or virtual enterprise server). We can replace the traditional models of web servers with smaller and much more adaptable virtualized software containers that offer advantages such as speed, portability, and scalability to our microservices.

4.1 Containers or virtual machines?

4.2 What is Docker?

4.3 Dockerfiles

4.4 Docker Compose

4.5 Integrating Docker with our microservices

4.5.1 Building the Docker Image

4.5.2 Creating Docker images with Spring Boot

4.5.3 Launching the services with Docker Compose

Summary