Creating a Tomcat container
In this section, we will create a container with the Tomcat web server installed so that we can deploy Java-based web applications into it:
- Create an account in Docker hub and
Login
:

- We can search different images from the Docker hub:

- You can find the Tomcat image at https://hub.docker.com/_/tomcat/.
- Use Docker's
pull
command to get the Tomcat image:
docker pull tomcat
- Once the Tomcat image is available, verify it using the
docker images
command:

- To run docker container from the image, run
docker run -it --rm -p 8888:8080 tomcat:8.0
.
- Use the IP address of the default docker machine and port
8888
in the browser to verify whether Tomcat is running properly in the container or not:

- To get the IP address of the virtual machine, execute
docker-machine ls
command.
Let's verify whether we have access to the Tomcat manager application in this container:

What we will do here is, create a new image with our own tomcat-users.xml
, where we will create a user with the manager...