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

docker-compose.yml version is not preserved #89

Open
erithmetic opened this issue Apr 2, 2018 · 5 comments
Open

docker-compose.yml version is not preserved #89

erithmetic opened this issue Apr 2, 2018 · 5 comments
Labels
Milestone

Comments

@erithmetic
Copy link
Contributor

Example project:

.
└── pods
   ├── db.yml
# in pods/db.yml
version: "2.1"
services:
  db:
    healthcheck:
      test: ["CMD", "true"]

When I run cage up I get:

ERROR: The Compose file '/foo/.cage/pods/db.yml' is invalid because:
Unsupported config option for services.db: 'healthcheck'
Error: error running 'docker-compose -p foo -f /foo/.cage/pods/db.yml up -d'

Looking at /foo/.cage/pods/db.yml, I see that it's configured with version: "2".

Expected: /foo/.cage/pods/db.yml should have version: "2.1"

My hunch is that cage is creating an empty compose_yml::v2::File which gets a default version of "2": https://github.com/emk/compose_yml/blob/b660f32fd4579a7e90526b51e0b97456b0b23c3e/src/v2/file.rs#L102

@emk
Copy link
Contributor

emk commented Apr 3, 2018

Let's just convert version: "2" to version: "2.1" whenever we can.

Oh, yeah, if you want me to look at PRs and I don't respond in a day or two, feel free to ping me again. The only way I see cage PRs this month is if they show up on GitHub notifications, and you should feel free to abuse them. :-)

@erithmetic
Copy link
Contributor Author

That sounds good. The minimum docker version for compose 2.1 is v1.12.0, which is almost 2 years old now.

@roman-biqmind
Copy link

roman-biqmind commented Aug 3, 2018

@dkastner @emk
Any updates on this issue? I'd really love to use healthcheck.

@emk
Copy link
Contributor

emk commented Oct 3, 2018

@dkastner @roman-biqmind Does anybody know the current state of any PRs associated with this? I'd like to take another look and see if there's anything I can merge. Thank you!

@emk
Copy link
Contributor

emk commented Apr 15, 2020

At this point, we're using version: 2.4 as our internal version, and we're applying JSON validation on output using the official schemas from docker-compose. But we're outputting version: "2", and we should really output version: "2.4".

@emk emk added the bug label Apr 15, 2020
@emk emk added this to the v0.3.0 milestone Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants