Skip to content

[BUG] docker compose up -d waits even without --wait #13426

@rltas

Description

@rltas

Description

After adding healtheck and depends_on to our GitLab resp. Zoekt services, docker compose up -d doesn't return until GitLab is healthy, despite not having specified --wait.
Am I misreading the docs or should it return immediately in this case? GitLab needs quite a while to warm up, so I just may have missed that behaviour in other cases.

Image Image

Steps To Reproduce

With services configured like this:

services:
  gitlab:
    image: gitlab/gitlab-ee:18.6.1-ee.0
    healthcheck:
      test: python3 -c 'import requests; r=requests.get("http://localhost/-/readiness"); print(r.json()["status"]);' 2>/dev/null | grep -q -x 'ok'
      interval: 10s
      retries: 12
      start_period: 60s

  zoekt-index:
    image: registry.gitlab.com/gitlab-org/build/cng/gitlab-zoekt:v18.6.1
    environment:
      GITLAB_ZOEKT_MODE: indexer
    depends_on:
      gitlab:
        condition: service_healthy

  zoekt-web:
    image: registry.gitlab.com/gitlab-org/build/cng/gitlab-zoekt:v18.6.1
    environment:
      GITLAB_ZOEKT_MODE: webserver
    depends_on:
      gitlab:
        condition: service_healthy

Compose Version

Docker Compose version v2.40.3

Docker Environment

Client: Docker Engine - Community
 Version:    29.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.30.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.40.3
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 7
  Running: 7
  Paused: 0
  Stopped: 0
 Images: 31
 Server Version: 29.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: gelf
 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: 1c4457e00facac03ce1d75f7b6777a7a851e5c41
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-163-generic
 Operating System: Ubuntu 22.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 22.91GiB
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions