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

Skip to content

Conversation

@ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Oct 31, 2023

What this PR does / why we need it:
Introduce support for inlined content when defining a configuration file

Which issue(s) this PR fixes:
Fixes #346

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as nit to make things clearer

08-configs.md Outdated
The top-level `configs` declaration defines or references configuration data that is granted to services in your Compose application. The source of the config is either `file` or `external`.

- `file`: The config is created with the contents of the file at the specified path.
- `environment`: The config is created with the value of an environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `environment`: The config is created with the value of an environment variable.
- `environment`: The config content is created with the value of an environment variable.

@Bilge
Copy link

Bilge commented Nov 27, 2023

How does one benefit from this change? With the latest Docker Desktop 4.25.2 (129061), I get configs.fpm Additional property content is not allowed.

@polarathene
Copy link

configs.fpm Additional property content is not allowed.

I also tried this since it's published on the docs (configs top-level page, service configs attribute) and there is no min version description, so I assumed it was already available at some point.

I looked through the release notes and found nothing (not too fun with fairly generic keywords configs / content).

Then I tried to track down the source from the docs:

That was a bit of a mission 😅 Didn't realize the feature was that new. I'm on v2.21.0 (Aug 30th).

I was on 4.23.0 (120376), but now also upgraded to the latest version is 4.25.2 (129061), but unfortunately that's not new enough 😆


TL;DR

How does one benefit from this change?

Docker Desktop 4.25.0 (released Oct 26th) provides Docker Compose 2.23.0 (docker compose version).

While 4.25.2 (Nov 21st) probably could have bumped the compose version, we'll probably have to wait a little bit longer for a new release to handle that.

@selivan
Copy link

selivan commented Dec 13, 2023

@ndeloof

I would like to suggest upgrading compose specification version for changes like this one.

Just now I've ran into this situation:

  • I write docker-compose.yml according to official docs
  • I specify the latest available version: "3.8"
  • docker compose does not complain about incompatibility with this version
  • And yet I get an error Additional property content is not allowed

That is confusing.

@ndeloof
Copy link
Collaborator Author

ndeloof commented Dec 13, 2023

I specify the latest available version: "3.8"

version is obsolete with compose-spec, it is ignored. Compose spec isn't versioned by design. The compose (tool) version you're using will let you know it can't parse your compose file if you use a recent addition.

docker compose does not complain about incompatibility with this version
And yet I get an error Additional property content is not allowed

This is exactly what "complain about incompatibility" is about. Maybe we should add "please upgrade docker compose" to this message.

@selivan
Copy link

selivan commented Dec 13, 2023

@ndeloof

Unfortunately, there is no way to distinguish between "please upgrade docker compose" and "you mistyped a keyword or used it on incorrect nesting level".

version is obsolete with compose-spec, it is ignored.

That is sad 😢

Look at terraform and terraform providers, for example. Each version explicitly has it's own specification. As long as you follow that specification for selected version - you will not run into compatibility issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configs inline content

5 participants