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
Exec Fails If Container #1 Does Not Exist #6155
Comments
Upon further research, it looks like I can use the I'd like to propose the default be the first image, instead of |
Yes - I do have a reliable test case, though will need to fetch it from work on Monday. I have some simple provisioning shell scripts I wrote, and the rolling upgrade script specifically triggers this issue. I'll post the test case Monday - feel free to bug me here if it slips from my radar. |
Here you go. In my case, I'm using this in the context of a poor-man's rolling deploy without getting into swarm. # running : app_1, app_2
docker stop "app_1"
docker rm "app_1"
docker-compose up -d --remove-orphans --no-recreate --scale app=2
# running : app_2, app_3
docker stop "app_2"
docker rm "app_2"
docker-compose up -d --remove-orphans --no-recreate --scale app=2
# running : app_3, app_4 This continues on infinitely, meaning that after a couple deploys, you end up in a situation like: app_37, app_38, and app_39 are the running containers. |
Thanks! Interesting - I'm surprised that the index 1 isn't always reallocated. I'll try and take a look at why it does that at some point. |
As was I! Figured it was probably not the desired behavior. |
I agree with @benyanke that docker-compose exec should take the first container comes up instead of hardcoded 1. Tested still has the error "No container found" for Docker version 18.09.2. Here's my workaround using docker exec @shin- :
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I haven't seen any work on this, so just commenting to un-stale it. |
This issue has been automatically marked as not stale anymore due to the recent activity. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it had not recent activity during the stale period. |
Still broken. Impossible to |
When using the
--scale
flag in non-swarm mode, containers are created like:If _1 gets killed, and the up command is run again, instead of _1 getting created again, it creates _4.
However, this causes exec to break, which appears to be hardcoded to _1.
If the following containers exist:
app_2
app_3
app_4
and you run:
docker-compose exec app bash
, the error is returned:ERROR: No container found for app_1
.The text was updated successfully, but these errors were encountered: