The Docker DX (Developer Experience) Visual Studio Code extension enhances your Visual Studio Code experience with Docker-related development by adding rich editing features and vulnerability scanning.
- Dockerfile linting: Get build warnings and best-practice suggestions via BuildKit and BuildX.
- Compose editing features: Provides contextual code completion, reference navigation, and schema descriptions in hovers.
- Bake editing features: Includes code completion, variable navigation, and inline suggestions for generating targets based on your Dockerfile stages.
- Image vulnerability scanning (experimental): Flags references to container images with known vulnerabilities directly within Dockerfiles.
The extension requires Docker Engine to be running. Install Docker Desktop on your machine and make sure the docker
CLI is available in your system PATH
.
This extension currently supports the following operating systems and architectures:
Operating system | Architectures |
---|---|
Windows | amd64 , arm64 |
macOS | amd64 , arm64 |
Linux | amd64 , arm64 |
Alpine | amd64 , arm64 |
If you are on an unsupported system, let us know of your interest in this extension so we can prioritize the work accordingly.
You can get linting checks from BuildKit and BuildX when editing your Dockerfiles.
Any references to images with vulnerabilities are also flagged. Note: This is an experimental feature.
Errors are visible directly in your editor or you can look at them by opening up the Problems panel (Ctrl+Shift+M on Windows/Linux, Shift+Command+M on Mac).
Code completion support in the Docker DX extension goes beyond just the Compose schema. The Docker DX extension understands the contextual link between your Compose file and your Dockerfile.
Compose files can get pretty big and complicated when you start including other files. Docker DX lets you hover over a reference to quickly see how something is defined.
You can get code completion when editing your docker-bake.hcl
file. You are also able to hover over variables and navigate around the file by jumping to a variable's definition or jumping to the build stage within a Dockerfile.
The extension provides inline suggestions to generate a Bake target to correspond to each build stage in your Dockerfile.
GitHub Actions builds eight .vsix
files - one for each platform combination (Windows, macOS, Linux, Alpine Linux x amd64
/arm64
).
Note: The language server binary from these builds are not signed and/or notarized. You may encounter issues when using .vsix
files from this repository as your operating system may refuse to open an unsigned binary.
To debug the VS Code extension, clone this repository and then run npm install
. This will download a binary of the Docker Language Server to the bin
folder. If you would like to test your own custom build of the language server, simply replace the file in the bin
folder with your own binary.
- Clone the docker/docker-language-server repository
- Start the language server in debug mode with the
--address :49201
argument. - In VS Code, update the
docker.lsp.debugServerPort
setting to49201
. This is the default port that is used for any launch configurations saved in Git. - Launch the extension in debug mode. It will connect to the language server you started in debug mode instead of trying to execute a binary in
bin/
.
Run npm test
to launch the UI tests.
The Docker DX extension collects telemetry. We collect this telemetry so that we can improve the extension by understanding usage patterns and catching crashes and errors for diagnostic purposes. Note that if you have already opted out of sending telemetry in Visual Studio Code then no telemetry will be sent.
See TELEMETRY.md for details about what kind of telemetry we collect and how to configure your telemetry settings.
Please refer to FAQ.md for our list of frequently asked questions.