Vscode-docker: Linting support for docker-compose.yml files

Created on 28 Oct 2016  路  10Comments  路  Source: microsoft/vscode-docker

It would make it a lot simpler to author Dockerfile and docker-compose.yml files if you could view actionable linting errors from within VS Code. For example, Docker Compose includes JSON schema files for its various formats (e.g. v2.0) that document how to determine whether a compose file is valid or not.

duplicate language-server

Most helpful comment

A complete list of all versions is available here https://github.com/docker/compose/tree/master/compose/config

All 10 comments

Updating this to mention just docker-compose.yml files, since we recently introduced linting suport for Dockerfiles.

Any chance to see this soon?

@rcjsuen is supporting this feature on your roadmap?

@PrashanthCorp I have considered this in the past but never even got started working on a prototype.

I assumed people would use some sort of YAML editor/validation tool to support this use case...but maybe not everyone wants to install a YAML editor.

A docker-compose.yml file can be valid yaml but not valid for docker-compose. I think linting if keys exist and have proper values set would be very valuable for this extension.

Anyone on this ticket that needs this should be able to get something decent with Red Hat's YAML extension. You can use something like the following in your settings.json file.

{
    "yaml.schemas": {
        "https://raw.githubusercontent.com/docker/cli/master/cli/compose/schema/data/config_schema_v3.8.json": "docker-compose.yml"
    }
}

A complete list of all versions is available here https://github.com/docker/compose/tree/master/compose/config

Thanks for finding that @SuperSandro2000!

This is also available on schemastore:
https://www.schemastore.org/json/

Duping to #2539

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bradygmsft picture bradygmsft  路  7Comments

gngchrs picture gngchrs  路  3Comments

Szauka picture Szauka  路  6Comments

chrisdias picture chrisdias  路  7Comments

sajayantony picture sajayantony  路  6Comments