Creating the image

Our project was previously configured with the Maven Docker plugin. We can generate the Docker image with the Maven Docker plugin using the docker:build goal. Then, it is time to generate our Docker image.

To generate the Docker image, type the following command:

mvn clean install docker:build

Now, we must wait for the Maven build and check if the Docker image was generated with success.

Check the Docker images and we should see the new image generated. To do this, we can use the docker images command:

docker images

Right, we should see the springfivebyexample/tracked_hashtag:latest on the image list, like the following screenshot:

Awesome, our Docker image is ready to run with our first Spring Boot Application in the ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.