Docker DX extension for Visual Studio Code
Go to file
Remy Suen 29879c9c50
Merge pull request #199 from docker/update-release-build-steps
Update the build and documentation around the release process
2025-08-21 09:14:58 -04:00
.devcontainer chore: install docker-cli in devcontainer 2025-03-20 17:27:58 +03:30
.github Update the build and documentation around the release process 2025-08-21 09:11:03 -04:00
.vscode Format JavaScript files with Prettier 2025-08-13 09:04:59 -04:00
build Update the Docker Language Server to v0.17.0 2025-08-21 08:54:15 -04:00
configs Add language configuration for dockerbake 2025-08-07 09:30:36 -04:00
misc Create an empty JSON file that can be publicly accessible 2025-07-02 06:09:27 -04:00
resources Use an alternate logo from the design team 2025-07-25 15:02:49 -04:00
src Refactor the GHA workflows to automate part of the release process 2025-08-13 12:04:24 -04:00
test Refactor the GHA workflows to automate part of the release process 2025-08-13 12:04:24 -04:00
.eslintrc.json Add GHA 2025-03-21 12:58:12 +00:00
.gitignore Introduce vscode-extension-tester to support UI testing 2025-04-02 13:57:15 -04:00
.prettierignore Refactor the GHA workflows to automate part of the release process 2025-08-13 12:04:24 -04:00
.prettierrc.yml Create a Visual Studio Code extension to support Docker file types 2025-03-18 16:08:38 -04:00
.vscodeignore Ignore the misc/ folder 2025-07-02 08:57:21 -04:00
CHANGELOG.md Update the Docker Language Server to v0.17.0 2025-08-21 08:54:15 -04:00
CONTRIBUTING.md Rename the extension tentatively to Docker DX 2025-03-26 07:56:09 -04:00
DEBUGGING.md Ignore the Markdown JSONC code block 2025-07-23 10:46:55 -04:00
FAQ.md State where the logs can be found 2025-07-23 16:14:19 -04:00
LICENSE Create a Visual Studio Code extension to support Docker file types 2025-03-18 16:08:38 -04:00
NOTICE.html Update NOTICE.html 2025-04-02 11:27:04 +01:00
README.md Update the build and documentation around the release process 2025-08-21 09:11:03 -04:00
SECURITY.md Rename the extension tentatively to Docker DX 2025-03-26 07:56:09 -04:00
TELEMETRY.md Change how Compose features are exposed 2025-06-02 14:25:15 -04:00
package-lock.json Prepare for the v0.15.0 release 2025-08-13 16:48:45 +00:00
package.json Prepare for the v0.15.0 release 2025-08-13 16:48:45 +00:00
tsconfig.json Introduce vscode-extension-tester to support UI testing 2025-04-02 13:57:15 -04:00
webpack.config.js Include the Dockerfile Language Server in the extension 2025-06-17 10:13:55 -04:00

README.md

Docker DX

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.

Key features

  • 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.

Requirements

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.

Feature overview

Editing Dockerfiles

You can get linting checks from BuildKit and BuildX when editing your Dockerfiles.

Any references to images with vulnerabilities are also flagged. This is an experimental feature and may change in the future. Refer to our FAQ.md to see how you can opt in or out of these warnings.

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).

Linting a Dockerfile for build warnings and the use of vulnerable images

Editing Compose files

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.

Editing a Compose file with code completion suggestions inferred from another file

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.

Hover over object references to see its YAML content

Editing Bake files

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.

Editing a Bake file with code completion and cross-file linking support

The extension provides inline suggestions to generate a Bake target to correspond to each build stage in your Dockerfile.

Suggesting Bake targets based on the content of the local Dockerfile

Build Debugging (EXPERIMENTAL)

This feature is under active development and requires version v0.26.1 of docker buildx or newer. This is disabled by default. Open DEBUGGING.md to learn more about this feature in Visual Studio Code and how to enable it.

For information about Buildx and the Debug Adapter Protocol, go here. If you have any bugs, feature requests, or feedback about Buildx's support for Debug Adapter Protocol, please report them here.

Builds

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.

Development

To develop this extension, you should first make sure you have the following extensions installed:

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.

Debugging both the extension and language server

  1. Clone the docker/docker-language-server repository
  2. Start the language server in debug mode with the --address :49201 argument.
  3. In VS Code, update the docker.lsp.debugServerPort setting to 49201. This is the default port that is used for any launch configurations saved in Git.
  4. 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/.

Testing

Run npm test to launch the UI tests.

Releasing

Follow the following steps to create a new release of the Docker DX Visual Studio Code extension:

  1. Run the "prepare release" workflow with the desired bump in semantic versioning. This workflow will update CHANGELOG.md, package.json, and package-lock.json and create a pull request with the three files.
  2. Review the generated pull request.
    1. The pull request's description will describe the changes to the three files. Verify that the changes make sense.
    2. If the changes look good and the builds and checks have completed and passed, approve the pull request and merge it manually.
  3. Now that the pull request has been merged into the main branch, a build named "Build: Automatic" will be triggered. Wait for the automated build from the "build" workflow to complete.
  4. If the build has completed successfully, use the "Run workflow" button to manually trigger the "build" workflow.
  5. This manually triggered workflow will start a "Build: Release" which will run the tests, create the release, build the binaries, and attach the binaries to the release.
  6. When the workflow has completed, open the releases page. It should have been automatically generated by the workflow and the resulting VSIX files should be attached to the release.

Telemetry

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.

FAQ

Please refer to FAQ.md for our list of frequently asked questions.

License

Apache License Version 2.0