Compose: How to specify CMD in the yml file?

Created on 10 Apr 2015  路  6Comments  路  Source: docker/compose

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'

Most helpful comment

You'll need to use command:. See the documentation; https://docs.docker.com/compose/yml/#command

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dazorni picture dazorni  路  3Comments

maltefiala picture maltefiala  路  3Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  3Comments

saulshanabrook picture saulshanabrook  路  3Comments

HackerWilson picture HackerWilson  路  3Comments