Compose: Feature to name container from "docker-compose run"

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

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.

Most helpful comment

@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.

All 6 comments

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.

Thanks for this feature. I notice that "docker-compose run " doesn't seem to use the custom name. I think I would expect that as well to use the container_name as opposed to just for "up".

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

foxx picture foxx  路  3Comments

maltefiala picture maltefiala  路  3Comments

bergtwvd picture bergtwvd  路  3Comments

HackerWilson picture HackerWilson  路  3Comments

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