-
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
[BUG] Problem to monitor specific docker container events during docker resources conversion from v1 to v2.16 in production #10467
Comments
The convergence logic relies on a hash being computed based on yaml configuration, but as we switched from Python to Go we can't make this hash equivalent between compose v1 and v2. So, While backward compatibility and interoperability has been a major requirement while developing Compose v2, it still comes with a few breaking chances (so the major release number bump). Please not this only happens as you switch to Compose v2. Is there any reason you need to use both tools on the same application ? |
I think I was not clear enough in my description of the problem. The problem is the difference of behavior between : I just noticed in changelog v2.16 : I think pull request 10236 is linked to my observation. |
ok, I'll look into this later this week |
Hi, I moved reproduce steps to dedicated "reproduce step" and I added a description to better explain our problem with docker-compose v2.1.6.0 change. |
Actually, this is desired: This is really internal implementation detail, so could you please explain how you noticed this change and what's your use case monitoring such events ? |
By the way, you should better rely on container labels, not names, to track compose resources. |
Description
I am working on an application which include docker-compose to deploy docker-compose services.
When development has started, docker-compose was in version v1 and we released our project in production which deployed several docker-compose resources in docker-compose v1 version.
Now, we intend to release a new version of the project in production with docker-compose v2.
We do not want to use the compatibility flag in case this compatibility is not supported in the future.
The challenge is to make the project able to "convert" docker resources in production from compose v1 conventions to v2 conventions.
With compose v2.15.1, it was working properly by use "compose up --no-start" to recreate containers with new names.
But with compose v2.16.0, with the new recreate logic, the mecanism is broken with new prefix added to create event. Indeed we listen to docker events to monitor containers states. With new prefix added to canonical name for docker create event, we cannot monitor anymore the docker container status.
Why do this recreate logic has been changed ?
Steps To Reproduce
OS : Ubuntu 22.04
Let's install the three following docker-compose versions on the VM :
Let's consider following docker-compose file :
We listen to docker events :
docker events
Let's execute following command with docker-compose v1 :
And then we execute the following command with docker-compose v2.15.1 :
We obtain the following docker events :
We observe that the second docker event "create" has property name equal to "myproject-myservice-1".
Let's clean project :
docker-compose-2.15.1 -p myproject down
Let's execute following command with docker-compose v1 again :
And then we execute the following command with docker-compose v2.16.0 this time :
We obtain following docker events :
We observe that the second docker event "create" has property name equal to "829e738869c4_myproject-myservice-1".
A prefix has been added to the container name.
Is this change in behavior a desired behavior or is it a bug ?
Thank you,
Damien Klotz
Compose Version
1.29.2
2.15.1
2.16.0
Docker Environment
23.0.3
Anything else?
No response
The text was updated successfully, but these errors were encountered: