Suggest an editImprove this articleRefine the answer for “How do you rebuild images in Compose?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To rebuild images in **Docker Compose**, the `--build` flag is used. **Key point:** `up` is responsible for starting, `build` for rebuilding; the `--build` flag lets you do both in one step.Shown above the full answer for quick recall.Answer (EN)ImageTo rebuild images in Docker Compose, the `--build` flag is used. The most common command: ```bash docker compose up --build ``` It rebuilds the images from the Dockerfile from scratch and starts the containers. If the containers are already running, you can rebuild and restart them like this: ```bash docker compose up --build -d ``` An alternative is separate steps: ```bash docker compose build # rebuild images docker compose up -d # bring up containers ``` The idea is simple: `up` is responsible for starting, `build` for rebuilding. The `--build` flag lets you do this in one step.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.