Loading...
 

Docker


Cheat Sheet

  • Run netstat from host inside of a Container
    docker inspect --format '{{ .State.Pid }}' <ContainerName>
    
    returns PID of the container
    
    nsenter -t <PID> -n netstat -nap

Logging

Rotating Logs

  1. Create the file '/etc/logrotate.d/docker-container' with the following contents. NOTE: The 'copytruncate' parameter should take of the need to SIGHUP the process that is writing the log file.
    /var/lib/docker/containers/*/*.log {
        rotate 7
        compress
        size=50M
        missingok
        delaycompress
        copytruncate
    }

Show php error messages