Blog

12/08/2019

How to View Logs for a Docker Container



 

Pre-Flight Check
  • 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.

In the previous tutorials in this series we’ve installed Docker and got a container running, we listed which containers were running, and attached to a running Fedora container, and we’ve committed changes and created Docker images.

View Logs for a Docker Container

If 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 2c9d5e12800e

If you don’t know the container ID, then use this tutorial on how to list docker containers.

14/08/2019

How to KVM, QEMU start or stop virtual machine from command line (CLI)

KVM or Kernel Based Virtual Machine is a popular virtualization technology. It allows you to run virtual guest machines over a host machine. To start...
14/08/2019

How to Docker backup Saving and restoring your volumes

Running a Docker volume backup First, we spin up a temporary container, and we mount the backup folder and the target Docker volume to this container....
12/08/2019

How to Start and Enable Firewalld on CentOS 7

In this article, we discuss how to start and enable firewalld. It is highly recommended that you have a firewall protecting your server.Pre-Flight CheckThese...