I have a service where I need to specify a CMD. I figured I should be able to do this in docker-compose, but I got this error:
Unsupported config option for master service: 'cmd'
You'll need to use command:
. See the documentation; https://docs.docker.com/compose/yml/#command
thanks!
Link to the documentation is broken
looks like it's moved to https://docs.docker.com/compose/compose-file/, but a redirect is missing for the old location
This is a bit difficult to Google for some reason. Here is docs to v2: https://docs.docker.com/compose/compose-file/compose-file-v2/#command
May I suggest that this is aliased this to cmd
, or at the very least "cmd" is mentioned within the "command" section of the compose file reference. I've come to this page because I ran a search for "docker-compose yml cmd" and also searched the compose file reference page for "cmd" only to find out the name is different.
Please, be consistent in the interface or at least make it easy to find things by the tools we use. This is one of the first things we all learn as developers, for good reason.
Regards,
iain
Most helpful comment
You'll need to use
command:
. See the documentation; https://docs.docker.com/compose/yml/#command