I am using docker-compose version 2.17.2 on linux ubuntu and I get this error Message:
“Error response from daemon: Conflict. The container name “/buildx_buildkit_default” is already in use by container “eadcc8e7164bf66380fa38e3ef82b59a08858b6612989260877e17542addd877”. You have to remove (or rename) that container to be able to reuse that name.”
for a docker compose with two services. The problem is there is no container with the name befor I start it. I also defind the container_names in a specific way that docker compose doesn’t care about.
I think he makes a container with the first service and afterwards the wants to give the second one the same name. Is there any way to fix this? Am I missing something?
Is this container defined in a compose file or something that buildx would run when you want to build your images? How did you check the container names? docker ps -a would show you the stopped containers as well.
This compose file contains nothinglike the name in the error message
Did you do anyhting else than running docker compose up. Like creating a builder fo example in a CI pipeline or just a script which then runs docker compose up too?
Second question: do you have environment variables for buildx? Since you have too containers, if there is a variable that controls whether a new builder is created or not, it is possible the two build try to create the same.
Issue Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:8793 → 0.0.0.0:0: listen tcp 0.0.0.0:8793: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
Your suggestion is not related to the original discussion. Would you like to share it in a new topic? I can move your post to a new topic. (by the way your commands could work on Windows only only)
I had a properly functioning setup/system running Docker Engine version 25.0.3 and Docker Compose version 2.24.6
Using the same docker-compose.yml file the described problem occurred after upgrade to Docker Engine version 26.0.1 and Docker Compose version 2.26.1
the issue appears to be due to changes related to handling/parsing of file docker-compose.yml
the docker-compose.yml file makes use of both YAML aliases and BASH variables to define services.
docker compose version 2.24.6 handles/parses the file and yields the desired containers.
docker compose version 2.26.1 reports “container name “xxxx” is already in use” and doesn’t start any containers.
Additional/Update/Note:
For my case, if a container name is based upon a BASH variable, Docker Compose version 2.26.1 yields the message “container name “xxxx” is already in use”, whereas Docker Compose version 2.24.6 does not and starts the appropriately named container. For example: