Skip to content

[BUG] --yes or -y flag not being respected on docker compose publish on Azure DevOps pipeline #13722

@escherstair

Description

@escherstair

Description

Description

The same as #13148
The docker compose publish command is not respecting the -y or --yes flag as indicated in the documentation, when used in an Azure DevOps pipeline running on MS-hosted ubuntu-24.04 agent.

Steps To Reproduce

  1. Create a yml file with:
services:
  bindwarn:
    image: busybox:latest
    command: ["sh", "-c", "sleep 5"]
    volumes:
      - .:/data:ro # bind mount to trigger the prompt
  1. Run docker compose -f compose.yml publish -y "some-upstream-url"
    (the same happens if you use --yes)

  2. You will see the output:

you are about to publish bind mounts declaration within your OCI artifact.
only the bind mount declarations will be added to the OCI artifact (not content)
please double check that you are not mounting potential user's sensitive directories or data
bindwarn
/Users/dkloumar/work/docker-bug:/data:ro

and it waits forever.
If you cancel the pipeline running job, other lines appear on the output

##[error]The Operation will be canceled. The next steps may not contain expected logs.
Are you ok to publish these bind mount declarations? [y/N]: 
##[error]Bash exited with code 'null'.
##[error]The operation was canceled

Indicating that the -y flag was not respected.

Compose Version

Docker Compose version v2.40.3

Docker Environment

Client: Docker Engine - Community
 Version:           28.0.4
 API version:       1.48
 Go version:        go1.23.7
 Git commit:        b8034c0
 Built:             Tue Mar 25 15:07:16 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.0.4
  API version:      1.48 (minimum version 1.24)
  Go version:       go1.23.7
  Git commit:       6430e49
  Built:            Tue Mar 25 15:07:16 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.2.2
  GitCommit:        301b2dac98f15c27117da5c8af12118a041a31d9
 runc:
  Version:          1.3.4
  GitCommit:        v1.3.4-0-gd6d73eb8
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Docker compose version:
Docker Compose version v2.40.3

Anything else?

I can run the pipeline if I run
yes | docker compose -f compose.yml publish -y "some-upstream-url"

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