---
title: Rebuild a Single Docker Container
description: If you use Docker Compose to manage multiple containers, networking, etc. and need to rebuild a single service or container, here are a few commands that will help.
date: 2019-11-11
tags: Docker, Docker compose, service, container
source: https://brianchildress.co/blog/rebuild-single-docker-container-docker-composemd
---

# Rebuild a Single Docker Container

To rebuild a single service or container that was initially started Docker Compose, use the following command in your terminal:

```sh
docker-compose up -d --no-deps --build < service name >
```

| Command          | Description                                                                |
| :--------------- | :------------------------------------------------------------------------- |
| --build          | Build new Docker images before starting containers                         |
| --force-recreate | Recreate containers even if their image and configuration have not changed |
| -d               | Run containers in detached mode                                            |
| --no-dep         | Do not start linked services                                               |

_You can pass multiple service names._

```sh
docker-compose up -d --no-deps --build < service name 1 > < service name 2 >
```
**Alternatively** 

If you want to _stop_, _create_, and _start_ your containers you can use the following commands:

```sh
1) docker-compose stop < service name > // Stop running service
2) docker-compose rm < service name > // Remove service
3) Make any changes to configuration, files, etc.
4) docker-compose create < service name >
5) docker-compose start < service name >
```
