这是indexloc提供的服务,不要输入任何密码
Skip to content

[BUG] Building with bake hangs indefinitely #12998

@razzeee

Description

@razzeee

Description

Our CI started to hang on deployment somewhen last month, as we're not pinning docker compose.


❯ docker compose --verbose build
TRAC[0000] Docker Desktop integration not enabled       
WARN[0000] The "NODE_ENV" variable is not set. Defaulting to a blank string. 
WARN[0000] The "SENTRY_AUTH_TOKEN" variable is not set. Defaulting to a blank string. 
WARN[0000] The "NODE_ENV" variable is not set. Defaulting to a blank string. 
WARN[0000] The "SENTRY_AUTH_TOKEN" variable is not set. Defaulting to a blank string. 
WARN[0000] The "NODE_ENV" variable is not set. Defaulting to a blank string. 
WARN[0000] The "SENTRY_AUTH_TOKEN" variable is not set. Defaulting to a blank string. 
DEBU[0000] bake build config:
{
  "group": {
    "default": {
      "targets": [
        "web",
        "worker",
        "nginx",
        "api"
      ]
    }
  },
  "target": {
    "api": {
      "context": "/home/user/dev/project",
      "dockerfile": "/home/user/dev/project/Dockerfile",
      "args": {
        "BASIC_AUTH_TOKEN": "",
        "BASIC_AUTH_TOKEN_USER_IMAGE_EXPORT": "",
        "CI_COMMIT_SHA": "",
      },
      "tags": [
        "project-api"
      ],
      "target": "serve_api",
      "output": [
        "type=docker,load=true,push=false"
      ]
    },
    "nginx": {
      "context": "/home/user/dev/project/nginx",
      "dockerfile": "/home/user/dev/project/nginx/Dockerfile",
      "tags": [
        "project-nginx"
      ],
      "output": [
        "type=docker,load=true,push=false"
      ]
    },
    "web": {
      "context": "/home/user/dev/project",
      "dockerfile": "/home/user/dev/project/Dockerfile",
      "args": {
        "BASE_URL": "https://test-prog.domain.local/",
        "CI_COMMIT_SHA": "",
      },
      "tags": [
        "project-web"
      ],
      "target": "serve_web",
      "output": [
        "type=docker,load=true,push=false"
      ]
    },
    "worker": {
      "context": "/home/user/dev/project",
      "dockerfile": "/home/user/dev/project/Dockerfile",
      "args": {
        "BASE_URL": "https://test-proj.domain.local/",
        "BASIC_AUTH_TOKEN": "",
        "BASIC_AUTH_TOKEN_USER_IMAGE_EXPORT": "",
        "CI_COMMIT_SHA": "",
      },
      "tags": [
        "project-worker"
      ],
      "target": "serve_api",
      "output": [
        "type=docker,load=true,push=false"
      ]
    }
  }
} 
DEBU[0000] Executing bake with args: [bake --file - --progress rawjson --metadata-file /tmp/compose-build-metadataFile-1203980021.json --allow fs.read=/home/user/dev/project --allow fs.read=/home/user/dev/project --allow fs.read=/home/user/dev/project/nginx --allow fs.read=/home/user/dev/project] 
TRAC[0000] Plugin server listening on @docker_cli_d8df486f78df3b7357995be71bf0cef6 
DEBU[0005] otel error                                    error="<nil>"
^CTRAC[0055] Closing plugin server                        
TRAC[0055] Closing plugin server                        
DEBU[0055] otel error                                    error="<nil>"
DEBU[0055] otel error                                    error="<nil>"

I've took the liberty to shorten/edit the args. I've alse hit CTRL + C to abort it, as it would be hanging forever.

The other two command seems to work fine somehow.

Steps To Reproduce

Kinda hard, cause I can't share the repo.

  1. Running docker compose up with on our repo
  2. Hangs forever - will get killed after an hour on CI, thanks to gitlab (usually builds need around 8 min)

Compose Version

Everything > 2.37.0 I think

I can reproduce with 2.37.3 locally

Docker Environment

I downgraded from 28.3.0 earlier today, while trying to hunt this down. Both were showing this problem.

❯ docker info
Client: Docker Engine - Community
 Version:    28.2.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.25.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.37.3
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 77
  Running: 5
  Paused: 0
  Stopped: 72
 Images: 157
 Server Version: 28.2.0
 Storage Driver: overlay2
  Backing Filesystem: btrfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.15.4-200.fc42.x86_64
 Operating System: Fedora Linux 42 (Workstation Edition)
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 30GiB
 Name: nbssc305os
 ID: 0a158b0d-7ffa-46ad-a1b1-e5bf6766169e
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

Opting out of bake seems to solve the problem for us now on CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions