Skip to content
Docker extension for VS Code.
HTML TypeScript Other
Branch: master
Clone or download
philliphoff Updated CHANGELOG (#1436)
* Updated changelog

* Add link to relevant PR.
Latest commit d8640be Nov 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.azure-pipelines Containerize Blazor static web assets manifest (#1400) Nov 8, 2019
.github Send PR emails to fewer people (#1308) Sep 26, 2019
.vscode Fix incredibly obnoxious Problems window bug (#1282) Sep 17, 2019
resources
src Add `Open in Browser` command to running containers (#1429) Nov 15, 2019
test Use CustomExecution instead of ShellExecution (#1360) Nov 6, 2019
.gitattributes Miscellaneous fixes (#1422) Nov 13, 2019
.gitignore Use executeCommand(vscode.open) instead of opn (#903) Apr 24, 2019
.vscodeignore Prep for 0.7.0 release (#1117) Jul 9, 2019
CHANGELOG.md Updated CHANGELOG (#1436) Nov 15, 2019
LICENSE.md Updating readme file Nov 14, 2015
NOTICE.html Prepare for 0.9.0 release (#1407) Nov 8, 2019
README.md Change the pipeline status badge to nightly (#1434) Nov 15, 2019
extension.bundle.ts Remove docker.importCertificates (#1377) Nov 1, 2019
gulpfile.ts Support all `DOCKER_*` environment variables as VS Code settings (#998) Jun 17, 2019
main.js Use ctx.subscriptions to manage disposables (#1326) Oct 8, 2019
package-lock.json Prepare for 0.9.0 release (#1407) Nov 8, 2019
package.json Change the pipeline status badge to nightly (#1434) Nov 15, 2019
tsconfig.json Turn on noUnusedLocals (#926) May 21, 2019
tslint.json Move files into "src" and "resources" folders (#953) May 24, 2019
webpack.config.js Remove docker.importCertificates (#1377) Nov 1, 2019

README.md

Docker for Visual Studio Code (Preview)

Version Installs Build Status

The Docker extension makes it easy to build, manage and deploy containerized applications from Visual Studio Code. Check out the "Working with Docker" tutorial to get started.

Visit the wiki for additional information about the extension.

Prerequisites

Install Docker on your machine and add it to the system path.

On Linux, you must also follow the steps in “Manage Docker as a non-root user” from Post-installation steps for Linux because VS Code runs as a non-root user.

Features

  • Automatic Dockerfile, docker-compose.yml, and .dockerignore file generation (Open the command Palette, F1 by default, and search for Docker: Add Docker files to Workspace)
  • Syntax highlighting, hover tips, IntelliSense (completions) for docker-compose.yml and Dockerfile files
  • Linting (errors and warnings) for Dockerfile files
  • Command Palette (F1 by default) integration for the most common Docker commands (for example docker build, docker push, etc.)
  • Explorer integration for managing images, containers, registries, and more
  • Deploy images from a registry directly to Azure App Service
  • Debug .NET Core applications running in Linux Docker containers

Generating Docker Files

Press F1 (by default) and search for Docker: Add Docker Files to Workspace to generate Dockerfile, docker-compose.yml, docker-compose.debug.yml, and .dockerignore files for your workspace type:

dockerfile

Note: The docker-compose.yml and docker-compose.debug.yml files are not generated for all platforms, such as .NET Core applications, and are optional for Node.js applications.

Editing

Rich IntelliSense (completions) for Dockerfile and docker-compose.yml files:

IntelliSense for DockerFiles

Docker Commands

Many of the most common Docker commands are built right into the Command Palette (F1 by default):

commands

Docker View

The Docker extension contributes explorers to view and manage containers, images, registries, volumes, and networks. The right click context menus provide quick access to the same rich set of commands found in the Command Palette (F1 by default).

explorers

TIP: You can reorder the explorers by clicking and dragging on the explorer title. You can also hide the entire view by right clicking on the Docker icon or hide individual explorers by right clicking on the explorer title.

hideView hideExplorer

Debugging in Containers

With the Docker extension installed, you can easily debug .NET Core and Node.js apps within a container. Debugging support is enabled automatically when you dockerize your code with Docker: Add Docker Files to Workspace. To enable debugging for code that's already dockerized, open the Command Palette (F1 by default) and do Docker: Initialize for Docker Debugging.

debugging

Tasks

Use Visual Studio Code's tasks to build and launch Docker containers with custom settings like ports, volumes, networks, etc.

tasks

Registries

The first time you expand the registries explorer you'll be prompted to connect a registry. This will prompt you for credentials based on your provider (Azure, Docker Hub, etc.). These credentials will be stored in your operating system credentials vault (for example macOS keychain, Windows Credential Store) so that you don't need to sign in every time. You can right click on a registry provider to disconnect it and remove credentials from the OS store.

NOTE: Azure leverages the Azure Account Extension instead of storing Docker-specific credentials. After connecting Azure, you will be prompted separately to install that extension and/or sign in.

Deploy images to Azure App Service

With the Docker Explorer you can deploy images from Docker Hub Registries or Azure Container Registries directly to an Azure App Service instance. Check out this tutorial to get started.

Azure CLI

Microsoft ships the latest Azure CLI as a Docker image. You can easily launch a container running the CLI from the Command Palette (press F1 by default and search for Docker Images: Run Azure CLI). The extension will then run an interactive terminal attached to the container.

After the container is started, you will be prompted to sign in to your Azure account. From there, set the subscription you want to work with using az account set (you can see all of your subscriptions with az account list). You do not need to sign in every time you run the container because the extension volume mounts the local $HOME/.azure folder to the container's $HOME/.azure folder.

Connect to docker-machine

The default behavior of the extension is to connect to the local Docker daemon. You can connect to a docker-machine instance if you launch Visual Studio Code and have the Docker environment variables set in your environment or through the following VS Code settings: docker.host, docker.certPath, docker.tlsVerify, and docker.machineName.

Contributing

There are a couple of ways you can contribute to this repo:

  • Ideas, feature requests, and bugs: We are open to all ideas and we want to get rid of bugs! Use the Issues section to either report a new issue, provide your ideas or contribute to existing threads.
  • Documentation: Found a typo or strangely worded sentences? Submit a PR!
  • Code: Contribute bug fixes, features, or design changes:
    • Clone the repository locally and open in VS Code.
    • Install TSLint for Visual Studio Code.
    • Open the terminal (CTRL+ ` by default) and run npm install.
    • To build, open the Command Palette (F1 by default) and type in Tasks: Run Build Task.
    • Debug: press F5 (by default) to start debugging the extension.

Legal

Before we can accept your pull request you will need to sign a Contribution License Agreement. All you need to do is to submit a pull request, then the PR will get appropriately labelled (e.g. cla-required, cla-norequired, cla-signed, cla-already-signed). If you already signed the agreement we will continue with reviewing the PR, otherwise system will tell you how you can sign the CLA. Once you sign the CLA all future PR's will be labeled as cla-signed.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Telemetry

VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don’t wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.

License

MIT

You can’t perform that action at this time.