O'Reilly logo

Microservices Deployment Cookbook by Vikram Murugesan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Containerizing Microservices with Docker

In this chapter, we will focus more on how to package and ship our microservice. We will learn the following recipes:

  • Building an executable JAR using the Maven Shade plugin
  • Building an executable JAR using the Spring Boot Maven plugin
  • Installing and setting up Docker
  • Writing your Dockerfile
  • Building your Docker image
  • Running your microservice inside a Docker container
  • Pushing your image to Docker Hub

Building an executable JAR using Maven Shade plugin

Before we jump into this recipe, let's talk about why we are doing this. Our goal is to construct a shippable artifact that can be executed from any platform or machine. In order to do that, we have to make sure our final artifact has all dependencies packaged ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required