Docker Tools Tips and Tricks

This article covers troubleshooting tips and tricks for the Visual Studio Code Docker extension. See the Overview and quickstart articles for Node.js, Python, or ASP.NET for details on setting up and working with Docker.

Error "connect EACCES /var/run/docker.sock" on Linux

Since VS Code runs as a non-root user, you will need to follow the steps in "Manage Docker as a non-root user" from Post-installation steps for Linux to access Docker from the extension.

Docker containers and images have disappeared from Docker view

This is most likely caused by a conflict with another extension called Docker Explorer (not authored by Microsoft). To resolve this issue, use a workaround described vscode-docker issue #1609.

The extension does not find Docker on a remote machine

Error message "Failed to connect. Is Docker installed and running?"

  1. Make sure Docker engine is installed on the remote machine and that Docker CLI works (run docker ps from the terminal and ensure it does not return any errors).
  2. If you are using a remote development environment (remote machine via SSH, WSL subsystem, GitHub Codespace), make sure the Docker extension is installed remotely as well as locally.

Invalid URL errors

If you have a need to connect to a remote Docker daemon, we recommend using Docker contexts instead of a docker.host attribute in the settings. Check out this guide to learn how to create and use a context to communicate with a remote Docker daemon.

If you still need to override the Docker context you are currently using, make sure your DOCKER_HOST environment variable or docker.host attribute includes a protocol in the URL (for example, ssh://myuser@mymachine or tcp://1.2.3.4).

Note: Keep in mind that your docker.host attribute will override your Docker context and the DOCKER_HOST environment variable will override both the docker.host attribute and your Docker context.

Tip: In Powershell you can change your Docker environment variable with $ENV:DOCKER_HOST = 'ssh://username@1.2.3.4'

Questions and feedback

We love your feedback! If you have any ideas or suggestions, report an issue.