---
slug: "docker-compose-arguments-sequence"
title: "Order of Arguments in docker-compose run (Incorrect Order Prevents Launch and Makes Errors Hard to Identify)"
description: "Here's an example to illustrate how docker-compose commands can fail and produce confusing error messages if the arguments are not provided in the correct order."
url: "https://www.ytyng.com/en/blog/docker-compose-arguments-sequence"
publish_date: "2023-01-30T06:54:29Z"
created: "2023-01-30T06:54:29Z"
updated: "2026-02-27T12:15:00.075Z"
categories: ["Docker"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20250708/09c45050d7e04140957d0235db41a8e5.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# Order of Arguments in docker-compose run (Incorrect Order Prevents Launch and Makes Errors Hard to Identify)

```shell
docker-compose \
  -f my.docker-compose.yaml \
  run \
  --name container-name \
  --rm \
  service-name-in-yaml \
  /bin/bash -c "./manage.py help"
```

### Points to Note

Make sure to follow the order below strictly.

```shell
docker-compose
-f <definition file name>
run
[options]
service name in the docker-compose file
startup command
```

Options are written between the `run` (subcommand) and service name, but `-f` must be specified before the first subcommand.
