How To List and Attach to Docker Containers

List Containers

First we’ll list which containers we have running:

docker ps


Your result should look similar to this:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c09acd48a25 fedora:20 /bin/bash 55 minutes ago Up 53 minutes furious_heisenberg


To list all local containers use -a option:

docker ps -a


It is some times handy to view the latest created container, including non-running containers. Simply use the -l option:

docker ps -l


Attach to a Specific Container


To attach to a specific container you must have the <reference_page_text>Container ID. In this case, we’ll attach to the container with the ID 9c09acd48a25 :

docker attach 9c09acd48a25

 

  • 49 Users Found This Useful
Was this answer helpful?

Related Articles

How to Install and Configure phpMyAdmin on Ubuntu 14.04

phpMyAdmin is an open source tool used for the administration of MySQL. In addition to offering...

How to Disable SSLv3 for Exim and Protect Your WHM/cPanel Server from POODLE

There’s a new POODLE in town, but unfortunately it’s not the kind of pooch you want around....

How To Update the Kernel in CentOS / Red Hat

Updating the kernel on Red Hat Linux or CentOS Linux is a very simple process. Most commonly you...

How to Install the Cassandra Storage Engine for MariaDB 10.0 on CentOS 6

Step #1: Add the MariaDB Repository First, you’ll follow a simple best practice: ensuring the...

How to Display (List) All Jobs in Cron / Crontab

Servers can automatically perform tasks that you would otherwise have to perform yourself, such...

Powered by WHMCompleteSolution