¿Por qué se crea un moby/buildkit:buildx-stable-1 cuando intento compilar, lo que genera un conflicto de nombre de contenedor?

¿Por qué se crea un moby/buildkit:buildx-stable-1 cuando intento compilar, lo que genera un conflicto de nombre de contenedor?

Tengo el siguiente 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

Luego uso el siguiente script de shell para construir...

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

Pero cuando ejecuto el script de shell intenta crear un moby/buildkit:buildx-stable-1contenedor. Este contenedor falla y termino con el siguiente error en mi compilación...

 => 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.

¿Por qué sucede esto y cómo evito este conflicto?

Respuesta1

Este contenedor aparentemente fue creado por Docker BuildKit (el nuevo docker buildreemplazo), usando esta imagen: https://hub.docker.com/r/moby/buildkit

Para deshabilitar este contenedor, puede configurar la instancia del generador de forma predeterminada con:

docker buildx use default

información relacionada