Podman Compose is almost fully compatible with docker-compose, and rootless is safer — for everyday development you can just use it as Docker Compose ~
Core commands (copy and paste ready)
| Command | Description | Daily usage frequency |
|---|---|---|
podman-compose up -d | Start in the background | ★★★★★ |
podman-compose down | Stop and remove containers | ★★★★★ |
podman-compose down -v | Remove volumes too (full reset) | ★★★★ |
podman-compose ps | Check running status | ★★★★★ |
podman-compose logs -f | Watch all logs in real time | ★★★★ |
podman-compose logs -f 服务名 | Follow a specific service’s logs | ★★★★★ |
podman-compose build | Rebuild images | ★★★★ |
podman-compose pull | Pull the latest images | ★★★ |
podman-compose restart | Restart all services | ★★★ |
podman-compose exec 服务名 bash | Enter a container | ★★★★★ |
podman-compose run --rm 服务名 命令 | Run a one-off task | ★★★★ |
The ones I use most (just memorize these)
# 标准启动
podman-compose up -d --build
# 更新镜像后启动
podman-compose pull && podman-compose up -d --build
# 彻底删光重来(开发时超常用)
podman-compose down -v && podman-compose up -d --build
# 只重启/更新某个服务
podman-compose up -d --build web
# 进容器修东西
podman-compose exec web bashAll articles on this blog are licensed under CC BY 4.0 unless otherwise stated.
评论
TwikooArtalk
