Query Exchange

 View Only
  • 1.  check state of docker containers

    Posted Jul 10, 2019 08:50 PM

    Description: looks to see what state all docker containers are in. (running, paused, stopped)

    What The Data Shows: gives an audit of all your docker containers, and their respective states. this will show your total number of containers, and how many are running, paused or stopped. this can help to ensure up-time of production containers, and troubleshoot any potential issues.

    SQL: 

    SELECT substr(id,0,5) as "first 5 of ID",

    containers,containers_running,containers_paused,containers_stopped FROM (`docker_info`);

     


    #Linux
    #Community
    #ContainerSupport
    #HelpDeskOperations
    #Compliance


  • 2.  RE: check state of docker containers

    Broadcom Employee
    Posted Jul 11, 2019 02:49 AM

     would you consider just pulling the first five of the ID? That is about all you need to do anything in Docker with that container, and it doesn't clutter up the results. Here is an example:

    SELECT substr(id,0,5) as "first 5 of ID",

    containers,containers_running,containers_paused,containers_stopped FROM (`docker_info`);



  • 3.  RE: check state of docker containers

    Posted Jul 12, 2019 04:08 PM

    thanks Jnelson. I edited the query to reflect your suggestion



  • 4.  RE: check state of docker containers

    Broadcom Employee
    Posted Jul 12, 2019 08:22 PM