涵盖容器生命周期、磁盘清理、网络调试与 Docker Compose v2 语法
docker run -d --name my-app -p 8080:80 -v $(pwd)/data:/app/data --restart unless-stopped nginx:alpine
docker exec -it my-app sh # 或 bash
docker logs -f --tail 100 my-app
docker stats --no-stream
docker compose up -d --build
docker compose down --remove-orphans
docker compose ps
docker compose restart web
docker compose config
docker build -t my-app:v1.0.0 -f Dockerfile .
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"
docker history --no-trunc my-app:v1.0.0
docker save -o app.tar my-app:v1.0.0
docker load -i app.tar
docker system df
docker system prune -a -f
docker image prune -f
docker inspect my-app