microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.72k stars 1.4k forks source link

docker-in-docker fails locally (works in codespaces) #1687

Closed dsyer closed 1 year ago

dsyer commented 1 year ago

I have a fairly vanilla Ubuntu host which runs docker happily. When I start a devcontainer locally with docker-in-docker it fails. JSON:

{
    "name": "hello",
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "remoteUser": "vscode",
    "features": {
        "ghcr.io/devcontainers/features/docker-in-docker:1": {}
    }
}

Error:

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

The same JSON works in codespaces:

$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
Chuxel commented 1 year ago

This is now maintained out of devcontainers/features - raised https://github.com/devcontainers/features/issues/285 there.