devcontainers / devcontainers/features
getting ssh-add -l : error fetching identities: communication with agent failed (from within devcontainer with common-utils/docker-from-docker)
- Dominant language
- Shell
- Stars
- 1.5k
- Forks
- 621
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 9
Description
Hi,
I created a devcontainer using
```
{
"dockerComposeFile": "docker-compose.yml",
"service": "krypton-c-env",
"workspaceFolder": "/work/libaos",
"shutdownAction": "stopCompose",
"remoteUser": "aos-dev",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "aos-dev",
"uid": "10000",
"gid": "10001",
"installZsh": true,
"installOhMyZsh": true,
"upgradePackages": true,
"nonFreePackages": false
},
"ghcr.io/devcontainers/features/docker-from-docker:1": {
"version": "latest",
"username": "aos-dev"
}
},
"postCreateCommand": "conan profile detect",
"extensions": [
"atlassian.atlascode", "ms-vscode.cpptools", "numaru.vscode-ceedling-test-adapter",
"twxs.cmake", "ms-azuretools.vscode-docker", "ms-vscode.cpptools-extension-pack",
"ban.troff", "SonkengMaldini.conanlight", "afri-bit.vsconan",
"ryanluker.vscode-coverage-gutters"
]
}
```
I connect remotely to my linux vm within VSCode and ssh-add -l works, then I go within the devcontainer and ssh-add -l now report the error, causing all my git operation with the remote to fail.
I do see an output for "echo $SSH_AUTH_SOCK" on both ssh remote and within the devcontainer, but likely I am missing a mount of a particular socket as to enable ssh-agent communication between host and the devcontainer environment.
I am unclear if this is a mistake of mine, or something broken by common-utils.
Contributor guide
Research direction
Start by reproducing the supplied devcontainer configuration with common-utils and docker-from-docker, then compare SSH_AUTH_SOCK and agent access between the remote Linux VM and the container. Check whether the agent socket is mounted and usable inside the container. Done means ssh-add -l succeeds and Git operations using the remote work there.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100