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

Feature request: add json schema to validate the daemon settings #1922

Open
jdrouet opened this issue Jun 5, 2019 · 6 comments
Open

Feature request: add json schema to validate the daemon settings #1922

jdrouet opened this issue Jun 5, 2019 · 6 comments

Comments

@jdrouet
Copy link
Contributor

jdrouet commented Jun 5, 2019

Description

In docker cli, we already embed a json schema for docker compose, maybe we should have one also for the daemon settings.

Describe the results you expected:

Have a JSON Schema file with the settings definition

@thaJeztah
Copy link
Member

This change would be in the moby repository (which is where the daemon CLI lives), but yes, I definitely agree we need something for this. From moby/moby#34093 (comment)

However (without having deep-dived into the code) I have a feeling we're reinventing the wheel; I think we're looking at properly validating the daemon.json; the format is currently "badly" documented (just the example JSON in https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file), which could use some improvement overall.

Would it be an idea to define a JSON schema for the configuration file, and use that for validating? Possibly we can use the schema itself to generate documentation as well (which would be a win-win)

Some related issues;

@thaJeztah
Copy link
Member

One thing to take into account is daemon upgrades/downgrades may invalidate existing configuration files; we should either "error", or "warn" on those

@jacobseth
Copy link

Hey there, could I have a go at this?

@thaJeztah
Copy link
Member

@jcsirot did you already have a json-schema created? ^^

@jcsirot
Copy link
Contributor

jcsirot commented Jun 18, 2019

Well, I don't know. Maybe you wanted to ask @jdrouet :-D

@peter-curiousit
Copy link

For anyone like me looking for something to help write the daemon.json file, I found this: https://json.schemastore.org/dockerd.json

I'm not sure how accurate it is so YMMV

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

No branches or pull requests

5 participants