dependabot / dependabot/dependabot-core

development shell: allow propagation of SSH credentials

Open
#11,544 3 comments 0 reactions 0 assignees View on GitHub
L: docker T: feature-request
Dominant language
Ruby
Stars
5.8k
Forks
1.5k
Avg merge
2d 18h
Merged PRs (30d)
149

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Feature description

For some testing or debugging scenarios, it is necessary to propagate the current SSH agent and credentials into the development shell container: for example, when testing the update to the repo https://git.company.com/foo/bar access to which is enabled only through the git URL `git@git.company.com:foo/bar.git` with the SSH credentials. I suggest to extend `Dockerfile.development` and `Dockerfile.updater-core` for this.

Suggested steps to achieve the desired functionality:
* install `openssh-client` apt package when creating the development shell / updater Dockerfiles
* mount the `$SSH_AUTH_SOCK` file and `$HOME/.ssh` directory from the user session into the container
* set `SSH_AUTH_SOCK` inside the container to make the ssh credentials available for git access
* mount `$HOME/.gitconfig` into the container to make the global `insteadOf` config setting available inside the container

"Acceptance criteria":
- [x] the SSH command-line utilities such as `ssh-add` are available and can be used inside the development and updater container(s) - ✅ https://github.com/dependabot/dependabot-core/pull/11545
- [x] `ssh-add -l` shows the same ssh keys as in the "outside" user session -> https://github.com/dependabot/dependabot-core/pull/11683
- [ ] `$HOME/.gitconfig` file is mounted (read-only) and the git commands use it (the `insteadOf` mapping are in effect)
- [ ] one can clone a git repository for which ssh credentials are required
- [ ] `bin/docker-dev-shell` commands / flows work with the repositories for which ssh credentials are required to access

Contributor guide

Open the contributing guide

Research direction

Start with Dockerfile.development, Dockerfile.updater-core, and bin/docker-dev-shell, then review the checked and unchecked acceptance criteria. Verify the remaining mounts and git behavior in both containers, including the .gitconfig insteadOf mapping, cloning an SSH-only repository, and the relevant docker-dev-shell flows.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, dockerfile, git
Domain
developer-experience, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.