Reference: Docker

Challenge: creating a “sticky” post, like timezones … a quick reference for useful, but not-as-frequently used Docker commands. 

View Docker logs:

docker logs running_container_name

Container size / memory usage:

docker system df

docker ps -s

CLI in running container:

docker exec -it running_container_name bash

View dettached container log output:

docker attach --sig-proxy=false running_container_name

List specific # of running containers, newest on top:

docker ps --last #

Filter for unused images:

docker images --filter "dangling=true"

Remove all unused images:

docker rmi -f $(docker images --filter "dangling=true")

Remove all non-running containers:

docker rm $(docker ps -a -q) 

Port syntax:

-p exposed_container_port_in_Dockerfile:live_url_access_point_port

 

Reference:

https://aboullaite.me/docker-hacks/