devcontainer exec: no error message when Docker is not running on macOS

Open
#1,187 0 comments 0 reactions 1 assignee View on GitHub

@v-Kaniska244 is already working on this.

Since Apr 3, 2026.

Assessment

This issue has not been assessed yet.

Description

Problem

When running devcontainer exec command on macOS without Docker Desktop installed or running, the command exits with a non-zero exit code, but no error message is displayed on stderr. This forces developers to guess what went wrong.

Expected Behavior

The application should display a clear error message on stderr explaining that Docker cannot be reached, similar to what the docker CLI does.

Current Behavior

$ devcontainer exec poetry --version
# No output, just exits with code 1

Example of Good Error Messaging

The docker CLI provides helpful feedback:

$ docker ps
Cannot connect to the Docker daemon at unix:///Users/kamil/.docker/run/docker.sock. Is the docker daemon running?

Impact

Poor error messaging negatively affects developer experience (DX). Users can't quickly diagnose issues and must resort to debugging or searching through documentation.

Suggested Solution

When devcontainer exec fails to connect to Docker, it should print a descriptive error message to stderr, similar to:

Error: Cannot connect to Docker daemon. Is Docker Desktop running?

This would significantly improve the user experience and reduce confusion.

Dominant language
TypeScript
Stars
3k
Forks
461
Avg merge
13h 17m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from devcontainers/cli

All issues in devcontainers/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.