Initial commit with translated description

This commit is contained in:
2026-03-29 09:49:29 +08:00
commit 5327f55ce1
7 changed files with 338 additions and 0 deletions

43
commands.md Normal file
View File

@@ -0,0 +1,43 @@
# Essential Commands — Docker
Quick reference for common Docker operations.
## Container Lifecycle
```bash
docker run -d --name app -p 8080:80 image # start detached
docker ps # list running
docker ps -a # list all
docker stop app && docker rm app # cleanup
docker logs -f app # follow logs
docker exec -it app sh # shell into
```
## Image Management
```bash
docker build -t myapp:1.0 . # build
docker images # list
docker pull nginx:alpine # fetch
docker push registry/myapp:1.0 # publish
docker rmi $(docker images -q --filter dangling=true) # prune
```
## Compose
```bash
docker compose up -d # start stack
docker compose down # stop & remove
docker compose logs -f # follow all logs
docker compose ps # stack status
docker compose exec web sh # shell into service
```
## Cleanup
```bash
docker container prune # remove stopped
docker image prune # remove dangling
docker volume prune # remove unused (DESTRUCTIVE)
docker system prune -a --volumes # remove everything (DESTRUCTIVE)
```