O'Reilly logo

DevOps for Web Development by Mitesh Soni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing containers

Let's try to run the Tomcat container as a background process.

  1. It is best practice to run a Docker container as a background process to avoid accidentally stopping containers from the terminal:
  2. Use the -d parameter:
                [root@localhost Desktop]# docker run -d tomcat
                68c6d1f7bc631613813ffb761cc833156a70e2063c2a743dd2729fe73b2873f9
    
  3. 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
    
  4. Get the IP address of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required