-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
docker-compose run ignores the container_name directive #12295
Comments
You're using docker compose v1 which is End of Life for years. Urgently adopt Docker Compose v2 !
Can you please clarify the use-case you have to require a fixed container name ? |
Closing as user didn't provided requested detais |
I ran into this decade long conversation when trying to diagnose some docker build issues with 3rd party installers and >alpine3:19
My opinion is either honor container_name and error on run if one is already running, or if Hopefully someone sees this, but I won't hold my breath, the last conversation got closed then ignored for the better part of a decade. seems to me this community prefers open new, close quick, and conversation fragmentation instead of monitoring for activity on closed tickets. |
Description
See #1753 reported by @dunk and @aanand 's PR #1755 for more details.
In the #1753 issue reported, @dunk executed:
docker-compose up
docker-compose run myservice
PR #1930 adds a --name param to docker-compose allowing for one off executions with a custom name
Since a container with a fixed name is already running, the behavior of docker-compose run should be no different than that of docker-compose scale, which is basically the same thing as running docker run --name $some_name_that_already_exists.
Now, when running docker-compose up, the container_name directive is respected; when running docker-compose run myservice, the container_name directive is ignored and the default auto-generated container name is used.
Steps To Reproduce
No response
Compose Version
The text was updated successfully, but these errors were encountered: