devcontainers / devcontainers/features

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

Đang mở
#352 15 bình luận 0 reaction 0 người được giao Xem trên GitHub
cli-bug
Ngôn ngữ chính
Shell
Star
1.5k
Fork
621
Merge trung bình
6 ngày 53 phút
Pull request đã merge (30 ngày)
9

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện cấu hình devcontainer được cung cấp với common-utils và docker-from-docker, sau đó so sánh SSH_AUTH_SOCK và quyền truy cập agent giữa máy ảo Linux từ xa và container. Kiểm tra xem socket của agent có được mount và có thể sử dụng bên trong container hay không. Hoàn tất có nghĩa là ssh-add -l chạy thành công và các thao tác Git sử dụng kho lưu trữ từ xa hoạt động trong đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, shell
Lĩnh vực
devops, infrastructure
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.