You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.1 KiB
85 lines
1.1 KiB
# Home Server Multi-Container
|
|
|
|
## Building Images
|
|
|
|
Build all images:
|
|
```bash
|
|
docker compose build
|
|
```
|
|
|
|
Build all images without cache:
|
|
```bash
|
|
docker compose build --no-cache
|
|
```
|
|
|
|
Build a specific service:
|
|
```bash
|
|
docker compose build mysql
|
|
docker compose build api
|
|
```
|
|
|
|
## Starting Containers
|
|
|
|
Start all containers:
|
|
```bash
|
|
docker compose up
|
|
```
|
|
|
|
Start all containers in detached mode (background):
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
Build images and start containers:
|
|
```bash
|
|
docker compose up --build
|
|
```
|
|
|
|
## Stopping Containers
|
|
|
|
Stop all containers:
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
## Viewing Logs
|
|
|
|
View logs for all containers:
|
|
```bash
|
|
docker compose logs
|
|
```
|
|
|
|
View logs for a specific container:
|
|
```bash
|
|
docker compose logs mysql
|
|
docker compose logs api
|
|
```
|
|
|
|
Follow logs in real-time:
|
|
```bash
|
|
docker compose logs -f
|
|
```
|
|
|
|
## Check Container Status
|
|
|
|
```bash
|
|
docker compose ps
|
|
```
|
|
|
|
## Cleaning Up Images
|
|
|
|
Remove dangling images (images tagged as `<none>`):
|
|
```bash
|
|
docker image prune
|
|
```
|
|
|
|
Remove all unused images:
|
|
```bash
|
|
docker image prune -a
|
|
```
|
|
|
|
Preview what would be removed:
|
|
```bash
|
|
docker image prune --dry-run
|
|
```
|