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

Docker
2023-01-30 06:54 (3 years ago)
Order of Arguments in docker-compose run (Incorrect Order Prevents Launch and Makes Errors Hard to Identify)
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.

Categories

Archive