Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose.yml parsed incorrectly if it uses include: feature #612

Open
2 tasks done
Manu343726 opened this issue Sep 14, 2024 · 0 comments
Open
2 tasks done

compose.yml parsed incorrectly if it uses include: feature #612

Manu343726 opened this issue Sep 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Manu343726
Copy link

⚠️ Please verify that this bug has NOT been reported before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

Hi,

Right now I'm testing dockge as a possible substitute of Portainer. To test it so I have used a rather complex app deploy I have where instead of having a loooooong docker-compose.yml file I use the include: top level element across multiple files so that I can have each service in its own subdirectory.

After checking your source I've seen that the way Dockge interprets a stack config is simply by reading the docker-compose.yml file and transforming it to JSON. IIRC docker defines some complex behavior regarding the interpretation of these files in case the same stuff is declared multiple times across multiple files, so supporting this would not be as easy as recursively opening the files.

After a little bit of research I found that docker compose includes the command docker compose config for exactly this purpose. Given an input top-level compose file it returns the fully expanded file. I'm no way a TS expert, but if I find some time I will try to implement this myself using that tool.

What do you think?

👟 Reproduction steps

Use a compose file with an include directive such as:

include:
  - first_service.yml
  - second_service.yml

👀 Expected behavior

Dockge listing all containers/services in the stack.

Maybe? listing the full file in readonly mode? (See note bellow)

I don't expect to be able to edit such a file from the Dockge UI. I understand that a complex redesign of that view would be needed.

😓 Actual Behavior

Dockge UI shows the top-level file. It doesn't list services declared in other files.
It also adds an empty services: {} entry to the file if the top-level file itself does not define any service.

Dockge Version

1.4.2

💻 Operating System and Arch

Linux 6.9.12-3-MANJARO

🌐 Browser

Google Chrome 128.0.6613.138

🐋 Docker Version

Docker 27.1.2

🟩 NodeJS Version

No response

📝 Relevant log output

No response

@Manu343726 Manu343726 added the bug Something isn't working label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant