Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] Publish does not push all compose files when using "extends" with "profiles". #13276

@ogoulpeau-ledger

Description

@ogoulpeau-ledger

Description

It seems that docker compose publish misses pushing the associated "extends" files when using profiles.

Steps To Reproduce

  1. With the compose files:
  • docker-compose.yml:
services:
  etcd:
    extends:
      file: etcd/docker-compose.yml
      service: etcd
    environment:
      ETCD_DEBUG: true
    profiles: [ default ]
  • etcd/docker-compose.yml:
services:
  etcd:
    image: quay.io/coreos/etcd:v3.3.27
  1. Publishing the app as an OCI artifact:
docker compose --profile '*' publish oci://ghcr.io/my-org/my-compose-config:latest
  1. Results in failure when using that artifact:
  • Expected result:
$ docker compose -f oci://ghcr.io/my-org/my-compose-config:latest --profile default config
name: compose-issue
services:
  etcd:
    profiles:
      - default
    environment:
      ETCD_DEBUG: "true"
    image: quay.io/coreos/etcd:v3.3.27
    networks:
      default: null
networks:
  default:
    name: compose-issue_default
  • Actual results:
$ docker compose -f oci://ghcr.io/my-org/my-compose-config:latest --profile default config
INFO[0000] fetch failed after status: 404 Not Found      host=*** spanID=db89337f59236507 traceID=34db7b71f1b9c951ca3b337db583a63c
open ~/.cache/docker-compose/ff3638119f2b259733ec2bc62ace1501edf2f729e80cae8c625c71cf34d724f5/etcd/docker-compose.yml: no such file or directory

Compose Version

Docker Compose version v2.40.0

Docker Environment


Anything else?

Not using "profiles" in the main docker-compose.yml file works:

  • docker-compose.yml:
services:
  etcd:
    extends:
      file: etcd/docker-compose.yml
      service: etcd
    environment:
      ETCD_DEBUG: true
  • etcd/docker-compose.yml:
services:
  etcd:
    image: quay.io/coreos/etcd:v3.3.27

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