Score:3

Why is a moby/buildkit:buildx-stable-1 getting created when I try to build leading to a container name conflict?

ng flag

I have the following docker-compose...

version: "3.8"
services:
  proxy:
    container_name: proxy
    extra_hosts:
      - "host.docker.internal:host-gateway"
    build:
      context: proxy
      dockerfile: Dockerfile
    volumes:
      - ./proxy/certificate:/usr/cert
    ports:
      - "443:443"
  ui:
    container_name: ui
    restart: always
    build:
      context: frontend
    ports:
      - "80:80"
  backend:
    container_name: backend
    restart: always
    build:
      context: backend
    ports:
      - "8000:8000"
    environment:
      - API_KEY
      - GOLD_TOKEN

Then I use the following shell script to build...

#! /bin/bash
docker-compose build
docker-compose up -d

But when I run the shell script it tries to create a moby/buildkit:buildx-stable-1 container. This container fails and I end up with the following error in my build...

 => ERROR [internal] booting buildkit                                                                                                                                  0.9s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                     0.8s
 => => creating container buildx_buildkit_gallant_newton0                                                                                                              0.1s
[+] Building 0.9s (1/1) FINISHED                                                                                                                                            
 => CANCELED [internal] booting buildkit                                                                                                                               0.9s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                     0.8s
 => => creating container buildx_buildkit_gallant_newton0  
Error response from daemon: Conflict. The container name "/buildx_buildkit_gallant_newton0" is already in use by container "8b56bc95c1e26b736d0f297236adce9766f1363b1f94b35fcbc29ac96b4b61d3". You have to remove (or rename) that container to be able to reuse that name.

Why is this happening and how do I prevent this conflict?

JBSnorro avatar
ca flag
I got this for the first time immediately after upgrading Docker Desktop (on Windows) from `4.11.1` to `4.18.0`. On `4.11.1` my `docker compose up` command on my `docker-compose.yaml` _did_ work, so there's definitely a regression
Score:0
ar flag

This container is apparently created by Docker BuildKit (the new docker build replacement), using this image: https://hub.docker.com/r/moby/buildkit

To disable this container you can set the builder instance to default with:

docker buildx use default

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.