Docker 101: The Basics
I. How To Install Docker on CentOS 6 or How To Install Docker on CentOS 7 or How To Install Docker on Ubuntu 14.04 LTS or How To Install Docker on Fedora 20 or How To Install Docker on Fedora 21 II. How To List and Attach to Docker Containers III. How to Commit Changes and Create Docker Images IV. How to View Logs for a Docker Container
- As of June 2014 Docker has officially released v1.0.0.
- These instructions are intended for viewing logs for Docker containers.
- I’ll be working from a Liquid Web Core Managed CentOS 6.6 server (or CentOS 7, Ubuntu 14.04 LTS, Fedora 20, Fedora 21), and I’ll be logged in as root.
View Logs for a Docker ContainerIf you’re currently attached to a docker instance, then first disconnect (detach) from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q. To view the logs for a container it’s as simple as running just one command. Let’s take a look at the logs for container 2c9d5e12800e :
docker logs 2c9d5e12800eIf you don’t know the container ID, then use this tutorial on how to list docker containers.