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)

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.
Please rate this article
Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.