You will have to first pull the tomcat image using the below command:
$ sudo docker pull tomcat
Then you can run the tomcat as a container using this command:
$ sudo docker run -it -p 8888:8080 --name mytomcatcon tomcat
Now you can start working with tomcat, go into the tomcat container using this command:
$ sudo docker exec -it mytomcatcon bash
Hope that helped :)
Join docker training course if you are interested in becoming a docker master.