Commit container to image docker
Snapshot a running container's filesystem as an image
docker commit -m 'debug snapshot' <container> debug-snapshot:$(date +%s)
more docker
all 46 commands →
Run with resource limits
docker run --memory=512m --cpus=0.5 --oom-kill-disable=false myapp
Show container resource usage
docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}'
Remove dangling images
docker image prune -f
Remove everything unused
docker system prune -a --volumes -f
Copy file from container
docker cp <container>:/app/config.yaml ./local-config.yaml