Language server for Dockerfiles, Compose files, and Bake files
See the codeThe Docker Language Server is a language server for providing language features for file types in the Docker ecosystem (Dockerfiles, Compose files, and Bake files).
The Docker Language Server relies on some features that are dependent on Buildx. If Buildx is not available as a Docker CLI plugin then those features will not be available.
Ensure you have Go 1.24 or greater installed, check out this repository and then run make install. Alternatively you can run go install github.com/docker/docker-language-server/cmd/docker-language-server@latest to get the latest version.
Run make build to generate a binary of the Docker Language Server.
The Docker Language Server uses golangci-lint to lint the project. Run make lint to lint the project for issues.
Run make test to run the unit tests. If the BuildKit tests do not work, make sure that docker buildx build works from the command line.
If you would like to run the tests inside of a Docker container, run make test-docker which will build a Docker image with the test code and then execute the tests from within the Docker container. Note that this requires the Docker daemon's UNIX socket to be mounted.
Follow the following steps to create a new release of the Docker Language Server:
CHANGELOG.md and cause a pull request to be created.CHANGELOG.md file, no code changes have actually happened so no build will be triggered.
The main command for docker-language-server is docker-language-server start with --stdio or --address :12345:
When run in stdio mode, requests and responses will be written to stdin and stdout. All logging is always written to stderr.
Language server for Docker
Usage:
docker-language-server [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
start Start the Docker LSP server
Flags:
--debug Enable debug logging
-h, --help help for docker-language-server
--verbose Enable verbose logging
-v, --version version for docker-language-server
Use "docker-language-server [command] --help" for more information about a command.
On startup, the client can include initialization options on the initial initialize request.
textDocument/publishDiagnostics will be duplicated across the two language servers. By setting the experimental dockerfileExperimental.removeOverlappingIssues to true, the Docker Language Server will suppress the duplicated results. Note that this setting may be renamed or removed at any time.telemetry field. You can read more about this in TELEMETRY.md.dockercomposeExperimental.composeSupport attribute to false. The default value is true.{
"initializationOptions": {
"dockercomposeExperimental": {
"composeSupport:": true | false
},
"dockerfileExperimental": {
"removeOverlappingIssues:": true | false
},
"telemetry": "all" | "error" | "off"
}
}
To support textDocument/codeLens, the client must provide a command with the id dockerLspClient.bake.build for executing the build. If this is supported, the client can define its experimental capabilities as follows. The server will then respond that it supports code lens requests and return results for textDocument/codeLens requests for Bake HCL files.
{
"capabilities": {
"experimental:": {
"dockerLanguageServerCapabilities": {
"commands": [
"dockerLspClient.bake.build"
]
}
}
}
}
The Docker Language Server team develops and maintains the Docker DX Visual Studio Code extension.
See CLIENTS.md for details about how to configure the Docker Language Server with other language clients.
See TELEMETRY.md for details about what kind of telemetry we collect and how to configure your telemetry settings.
This project includes a fork of the tliron/glsp GitHub repository. The code can be found inside the internal/tliron/glsp folder.
Latest release
Releases this year
212 followers · starred Jul 2025
77 followers · starred Aug 2025
841 followers · starred Apr 2025
91 followers · starred Aug 2025
Language server for Dockerfiles, Compose files, and Bake files
See the codeThe Docker Language Server is a language server for providing language features for file types in the Docker ecosystem (Dockerfiles, Compose files, and Bake files).
The Docker Language Server relies on some features that are dependent on Buildx. If Buildx is not available as a Docker CLI plugin then those features will not be available.
Ensure you have Go 1.24 or greater installed, check out this repository and then run make install. Alternatively you can run go install github.com/docker/docker-language-server/cmd/docker-language-server@latest to get the latest version.
Run make build to generate a binary of the Docker Language Server.
The Docker Language Server uses golangci-lint to lint the project. Run make lint to lint the project for issues.
Run make test to run the unit tests. If the BuildKit tests do not work, make sure that docker buildx build works from the command line.
If you would like to run the tests inside of a Docker container, run make test-docker which will build a Docker image with the test code and then execute the tests from within the Docker container. Note that this requires the Docker daemon's UNIX socket to be mounted.
Follow the following steps to create a new release of the Docker Language Server:
CHANGELOG.md and cause a pull request to be created.CHANGELOG.md file, no code changes have actually happened so no build will be triggered.
The main command for docker-language-server is docker-language-server start with --stdio or --address :12345:
When run in stdio mode, requests and responses will be written to stdin and stdout. All logging is always written to stderr.
Language server for Docker
Usage:
docker-language-server [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
start Start the Docker LSP server
Flags:
--debug Enable debug logging
-h, --help help for docker-language-server
--verbose Enable verbose logging
-v, --version version for docker-language-server
Use "docker-language-server [command] --help" for more information about a command.
On startup, the client can include initialization options on the initial initialize request.
textDocument/publishDiagnostics will be duplicated across the two language servers. By setting the experimental dockerfileExperimental.removeOverlappingIssues to true, the Docker Language Server will suppress the duplicated results. Note that this setting may be renamed or removed at any time.telemetry field. You can read more about this in TELEMETRY.md.dockercomposeExperimental.composeSupport attribute to false. The default value is true.{
"initializationOptions": {
"dockercomposeExperimental": {
"composeSupport:": true | false
},
"dockerfileExperimental": {
"removeOverlappingIssues:": true | false
},
"telemetry": "all" | "error" | "off"
}
}
To support textDocument/codeLens, the client must provide a command with the id dockerLspClient.bake.build for executing the build. If this is supported, the client can define its experimental capabilities as follows. The server will then respond that it supports code lens requests and return results for textDocument/codeLens requests for Bake HCL files.
{
"capabilities": {
"experimental:": {
"dockerLanguageServerCapabilities": {
"commands": [
"dockerLspClient.bake.build"
]
}
}
}
}
The Docker Language Server team develops and maintains the Docker DX Visual Studio Code extension.
See CLIENTS.md for details about how to configure the Docker Language Server with other language clients.
See TELEMETRY.md for details about what kind of telemetry we collect and how to configure your telemetry settings.
This project includes a fork of the tliron/glsp GitHub repository. The code can be found inside the internal/tliron/glsp folder.
Latest release
Releases this year
212 followers · starred Jul 2025
77 followers · starred Aug 2025
841 followers · starred Apr 2025
91 followers · starred Aug 2025