This is a feature proposal/request to add a capability to docker-compose run
. I have checked in the docker and docker-dev IRC channels and looked at prior issues and it seems this isn't on the radar.
Currently, if you have a docker-compose.yml
you can start a specific container with possibly its dependencies using docker-compose run CONTAINER_NAME
. However, this starts/creates a new container with the ordinary compose name appended by _run_1
, where 1
could be any number. There is no way to tell docker-compose
what this should be named.
The main use case would be overriding the run command for a specific container (in my case flags for development/production mode), but keeping the original name. This change would allow for this and also be flexible enough to support any name.
This is blocked on #1066, and there is discussion there about making this possible once it's complete.
Sounds great that its on the roadmap.
Closing in favour of https://github.com/docker/compose/issues/1518
Thanks for this feature. I notice that "docker-compose run
@aanand I just experienced the same issue as @jylin - docker-compose run
does not seem to use container_name
configuration parameter, seems like a bug.
Any news on what @xelibrion mentions? I experienced the exact same behaviour docker-compose version 1.9.0, build 2585387
Most helpful comment
@aanand I just experienced the same issue as @jylin -
docker-compose run
does not seem to usecontainer_name
configuration parameter, seems like a bug.