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

Docker
2023-01-30 15:54 (2 years ago) ytyng
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.

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.

Current rating: 1
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011