Docker compose Confilct default container name already in use

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.

Yes the container is defined by an composerfile :

version: '3.8'
services:
  api:
    container_name: api_backend
    image: administrator/api:1
    build: ./api
    ports:
      - '3001:3001'

  client:
    container_name: client_frontend
    image: administrator/client:1
    build: ./client
    ports:
      - '3000:3000'
    stdin_open: true
    tty: true

Yes I checked with docker ps -a it shows a running container with the moby/buildkit:buildx-stable-1 name after running the docker-compose up command.

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.

No I didn’t crate a pipeline i’m pulling the repo manual and just typing docker-compse up.

I don’t think I have any environment variables, but I don’t know how to check

It’s either a .env file in your project folder or in variables in your shell which you can check by simply running

env