Book Image

Developing with Docker

By : Jaroslaw Krochmalski, Jarosław Krochmalski
Book Image

Developing with Docker

By: Jaroslaw Krochmalski, Jarosław Krochmalski

Overview of this book

This fast-paced practical guide will get you up and running with Docker. Using Docker, you will be able to build, ship, and run many distributed applications in real time. You will start with quickly installing Docker and start working with images and containers. We will present different types of containers and their applications, and show you how to find and build images. You will learn how you can contribute to the image repository by publishing different images. This will familiarize you with the image building process and you will be able to successfully run your programs within containers. By finishing this book, you will be well equipped in deploying your applications using Docker and will have a clear understanding of concepts, techniques, and practical methods to get it running in production systems.
Table of Contents (16 chapters)
Developing with Docker
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Spring Boot application in Docker container


For the purpose of our example, we will start with a simple hello-world type Spring Boot application. We are going to run in on top of official Java image: openjdk. If you prefer to run it on the Oracle Java image, you can search for it in the DockerHub registry. There are a lot of images that are ready to use, some of them are based on the official images, such as Ubuntu for example. As we saw in Chapter 6, Creating Images, it's always good to pick an official image as the base image. Official images are tested, supported, and usually of very high quality. The basic steps for creating Java application in the container are:

  • Using a base image pulled out from the Docker Hub

  • Installing the application itself, it will be an executable jar file in our case

  • Exposing ports, if your application needs to communicate with the outside world using a network

  • Running the container

Of course, if you would like to put another kind of application in the container,...