podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

podman-compose gets confused with symlinks and extends

Open sedrubal opened this issue 6 years ago • 8 comments

I have this repo structure:

Structure:

.
├── project1
│   ├── docker-compose.yml
│   └── Dockerfile
├── project2
│   ├── docker-compose.yml
│   └── Dockerfile
├── metarepo
│   └── docker-compose.yml
└── docker-compose.yml -> ./metarepo/docker-compose.yml

And this main docker-compose.yml:

docker-compose.yml

---
version: '2.4'

services:
  project1:
    extends:
      file: project1/docker-compose.yml
      service: project1

  project2:
    extends:
      file: project2/docker-compose.yml
      service: project2
...

A project-docker-compose.yml looks like this;

docker-compose.yml

---
version: "2.4"

services:
    project1:
        build: .
...

While this works with docker-compose, podman-compose gets confused. AFAIK there are multiple issues:

  1. podman-compose uses os.path.realpath instead of os.path.abspath in the line below to resolve the directory of the main docker-compose.yml. Thus podman-compose operates in metarepo/ directory instead of the main directory. https://github.com/containers/podman-compose/blob/efcbc75f631e693791a7f71abc49d9d05559ae92/podman_compose.py#L791
  2. podman-compose does not resolve the build path to project1/ / project2/. I think the extends logic is broken...

sedrubal avatar Mar 25 '20 11:03 sedrubal

I am also having this issue when trying to move a project from docker to podman. I received error messages described in #268.

LyricPants66133 avatar Feb 03 '22 19:02 LyricPants66133

podman-compose uses os.path.realpath instead of os.path.abspath

please send me PR and I'll merge it.

muayyad-alsadi avatar Feb 03 '22 20:02 muayyad-alsadi

Hey @muayyad-alsadi

I have created a PR for this issue. Can you please have a look at it?

Thanks a lot.

vansari avatar Feb 22 '22 05:02 vansari

although I've some comments, I'll merge it now and comment later when I get time.

I'll keep this open so that you check again when I'm done.

muayyad-alsadi avatar Feb 22 '22 11:02 muayyad-alsadi

When this fix will be released?

filipef9 avatar Feb 24 '22 14:02 filipef9

@filipef9 help us test latest push

muayyad-alsadi avatar Feb 25 '22 15:02 muayyad-alsadi