Managing containers
Let's try to run the Tomcat container as a background process.
It is best practice to run a Docker container as a background process to avoid accidentally stopping containers from the terminal:
Use the
-d
parameter:[root@localhost Desktop]# docker run -d tomcat 68c6d1f7bc631613813ffb761cc833156a70e2063c2a743dd2729fe73b2873f9
Verify the container you just created:
[root@localhost Desktop]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 68c6d1f7bc63 tomcat "catalina.sh run" 15 seconds ago Up 11 seconds 8080/tcp desperate_hypatia You have new mail in /var/spool/mail/root
Get the IP address of the container with the
docker inspect
command along with the container ID:[root@localhost Desktop...