Commit a container to an image

Saves the filesystem of a running container as an image

docker commit -m 'debug snapshot' <container> debug-snapshot:$(date +%s)

tool
docker46 commands
tags
dockerdebug

More docker commands

  • docker run --memory=512m --cpus=0.5 --oom-kill-disable=false myapp

    Limits the container to 512MB of RAM and half a CPU core

  • docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}'

    One-time snapshot of CPU and memory for all containers

  • docker image prune -f

    Deletes all untagged <none>:<none> images

  • docker system prune -a --volumes -f

    Deletes stopped containers and unused images, networks and volumes

  • docker cp <container>:/app/config.yaml ./local-config.yaml

    Copies one file from a running or stopped container

all 46 docker commands