How to Prevent VS Code Dev Container from Accessing Host SSH and GPG Keys?

0
0
Asked By CuriousCoder42 On

I'm trying to set up a development container in VS Code, but I'm running into a problem where it keeps mounting the SSH agent, GPG agents, and Git settings from my Mac. I really want to isolate the container from my local GPG and SSH keys completely.

I'm using a straightforward Dockerfile based on Debian and including git, openssh-client, and gnupg, along with a Docker Compose file. I've attempted to set various environment variables like SSH_AUTH_SOCK, GPG_AGENT_INFO, GPG_TTY, and GNUPGHOME in the Dockerfile, docker-compose.yml, and .devcontainer.json, but nothing seems to work! My container can still access my local keys by running ssh-add -L and gpg -k, and it's super frustrating!

Any advice on how to avoid this issue would be greatly appreciated! Just to clarify, I'm really looking to resolve the problem with VS Code leaking my host settings into the dev container, not necessarily making the project work. Thanks in advance!

0 Answers

There is no answer to this question yet. If you know the answer or can offer some help, please use the form below.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.