Running an application in Docker

So far, we have learnt what is Docker and the different commands to work with Docker. In this section, we will develop a web application and we will deploy the web application in a Docker container. For simplicity, we will download a Tomcat image from the Docker repository. Then the Docker container will be started with proper port mapping, so that it can be accessed from the host machine. Finally, a web application will be deployed in the running container.

To create a Tomcat container, we will pull an image from the central repository https://registry.hub.docker.com/_/tomcat/. The repository provides support for different versions of Tomcat such as 6, 7, and 8. For this application, we will use Tomcat 7.0.57 version. ...

Get Mastering Gradle 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.