Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container_name syntax breaks docker-compose run #1753

Closed
dunk opened this issue Jul 22, 2015 · 3 comments
Closed

container_name syntax breaks docker-compose run #1753

dunk opened this issue Jul 22, 2015 · 3 comments
Labels
Milestone

Comments

@dunk
Copy link

dunk commented Jul 22, 2015

When using the container_name syntax added in #1711 "docker-compose run" fails with a message like the following:

Conflict. The name "myservice" is already in use by container bc5601faea86. You have to delete (or rename) that container to be able to reuse that name.

Example docker-compose.yml:

myservice:
    container_name: myservice_name
    image: ubuntu:latest
    command: tail -f /dev/null

Commands run:

docker-compose up -d
docker-compose run --rm myservice /bin/sleep 3

"docker-compose run" is using the same directive to name its container, as can be verified by changing the container_name in docker-compose.yml after starting the service, and running:

docker-compose run -d myservice tail -f /dev/null

I changed the service name to "myservice_name_another", which became the instantiated container's name.

@aanand
Copy link

aanand commented Jul 22, 2015

D'oh. Fixing it now.

@dunk
Copy link
Author

dunk commented Jul 22, 2015

An otherwise extremely useful feature!

@aanand
Copy link

aanand commented Jul 22, 2015

#1755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants