devcontainers / devcontainers/features

getting ssh-add -l : error fetching identities: communication with agent failed (from within devcontainer with common-utils/docker-from-docker)

オープン
#352 コメント 15 件 リアクション 0 件 担当者 0 名 GitHub で見る
cli-bug
主要言語
Shell
スター
1.5k
フォーク
621
平均マージ
6日 53分
マージ済み PR(30日)
9

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、common-utils と docker-from-docker を使用して提供された devcontainer 構成を再現し、その後、リモート Linux VM とコンテナの間で SSH_AUTH_SOCK とエージェントへのアクセスを比較します。エージェントソケットがコンテナ内にマウントされ、使用可能かどうかを確認します。ssh-add -l が成功し、リモートリポジトリを使用する Git 操作がそこで機能すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, shell
領域
devops, infrastructure
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。