How to show the ID of the oldest running docker container?

I using docker Docker version 1.3.2, build 50b8feb. There are some new filters for the ps command, but it seems nothing provide what I need. I just want to see the oldest container running, to kill it, wait and kill the next oldest one. I hope somebody can come around with some bash magic I am not able to see at the moment. Thanks!


  • How to properly check if a Symfony application is installed?
  • Is there any way to override the “network/ipc” container in the kubernetes pod declaration?
  • Fig doesn't link two containers
  • TLS self-signed certificate for auth URL for Docker
  • zsh: command not found: dcos
  • Why should I use ribbon/hystrix/eureka instead of docker+haproxy for a microservice?
  • sort does not what I want since it also resorts before reverting order.

  • Docker install PHP-7-fpm with Memcache extention ? fails with Cannot find config.m4
  • How to pull new docker images to openshift cluster nodes from remote private registry?
  • Node.JS proxy with Nginx and Docker
  • docker: how-to install elasticsearch delete-by-query
  • Docker compose version 2 volumes not using specified location
  • Recommended way to run a Docker Compose stack in production?
  • One Solution collect form web for “How to show the ID of the oldest running docker container?”

    Oh yeah, captain obvious. I just needed to use tail.

    docker ps -aq | tail -n 1
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.