Creating Docker images

Docker, Docker, Docker! I hear this phrase more and more in all the conferences and tech meetups that I have attended. The arrival of Docker has been welcomed by the community with open arms and it has instantly become a hit. The Docker ecosystem has been rapidly expanding with many other companies providing services, support, and complementing frameworks such as Apache Mesos, Amazon Elastic Beanstalk, ECS, and Kubernetes, just to name a few. Even Microsoft is providing Docker support in their Azure Cloud Service and is partnering with Docker to bring Docker to Windows operating system.

The reason for Docker's overwhelming popularity lies in its ability to package and deploy applications in a form of self-contained containers. The containers are more lightweight than the traditional full-blown virtual machines. Multiple numbers of them can be run on top of a single OS instance, thus increasing the number of applications that can be deployed on the same hardware compared to traditional VMs.

In this recipe, we will take a look at what it would take to package our Spring Boot application as a Docker image and how to deploy and run it.

Building a Docker image and just running it on your development machine is doable, but not as much fun as being able to share it with the world. You will need to publish it somewhere for it to be deployable, especially if you are thinking of using it with Amazon or some other cloud-like environment. Luckily, Docker provides us with not only the container solution, but also with a repository service, Docker Hub, located at https://hub.docker.com, where we can create repositories and publish our Docker images. So think of it like Maven Central for Docker.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.247.196