Skip to content

[BUG] depends_on.required: false triggers exit status warning #10851

Description

@ShahimEssaid

Description

I updated to v2.20.2 to try out the required property. It is working but it's also triggering a warning that I can't explain. See the minimum example.

Steps To Reproduce

1. Run the following example in Ubuntu 22.04 and Compose 2.20.2
2. Example:

services:
  first:
    image: ubuntu
    command:
      - echo
      - hello from first
  second:
    image: ubuntu
    depends_on:
      first:
        condition: service_completed_successfully
        required: false
    command:
      - echo
      - hello from second
  1. Output
06:58 $ docker compose up
[+] Running 2/0
 ✔ Container tmp-first-1   Created                                                                                                                                                                                                                                      0.0s 
 ✔ Container tmp-second-1  Created                                                                                                                                                                                                                                      0.0s 
Attaching to tmp-first-1, tmp-second-1
tmp-first-1   | hello from first
tmp-first-1 exited with code 0
WARN[0000] optional dependency "first" didn't complete successfully: exit 0 
tmp-second-1  | hello from second
tmp-second-1 exited with code 0
  1. I do not understand the output line: WARN[0000] optional dependency "first" didn't complete successfully: exit 0

Compose Version

06:54 $ docker compose version
Docker Compose version v2.20.2

Docker Environment

06:58 $ docker info
Client: Docker Engine - Community
 Version:    24.0.5
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.20.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 5
  Running: 1
  Paused: 0
  Stopped: 4
 Images: 82
 Server Version: 24.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.19.0-46-generic
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 73.4GiB
 Name: WVM4
 ID: e82f8658-d07f-477c-ab34-a5f152ef9e34
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions