Skip to content

[BUG] COMPOSE_PROJECT_NAME broken in docker compose exec since 2.18 #10593

@Feuermurmel

Description

@Feuermurmel

Description

docker compose exec (possibly also other subcommands) don't use COMPOSE_PROJECT_NAME anymore.

Steps To Reproduce

$ docker-compose-darwin-aarch64-2.17.3 -f dev_resources/docker_compose/my-project.yaml up -d
$ docker-compose-darwin-aarch64-2.17.3 ls
NAME          STATUS              CONFIG FILES
my-project    running(7)          /[...]/dev_resources/docker_compose/my-project.yaml
$ export COMPOSE_PROJECT_NAME=my-project
$ docker-compose-darwin-aarch64-2.17.3 exec postgres pg_isready
/var/run/postgresql:5432 - accepting connections
$ docker-compose-darwin-aarch64-2.18.0 exec postgres pg_isready
no configuration file provided: not found

Compose Version

2.18.0

Obvious source of the bug: 3340f7f#diff-2922e5cbd75acccf0c12784852f77f143247e72a57719e883225f10f960acd40R178

Docker Environment

Client:
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /Users/cs/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.3
    Path:     /Users/cs/.docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/cs/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.19
    Path:     /Users/cs/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.4
    Path:     /Users/cs/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/cs/.docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /Users/cs/.docker/cli-plugins/docker-scan
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  v0.10.0
    Path:     /Users/cs/.docker/cli-plugins/docker-scout

Server:
 Containers: 10
  Running: 3
  Paused: 0
  Stopped: 7
 Images: 14
 Server Version: 23.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: cgroupfs
 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: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc version: v1.1.5-0-gf19387a
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 3.841GiB
 Name: docker-desktop
 ID: 801e1568-579a-4a52-9932-cce1d191b75b
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions