ensody / ssh-agent-inject Goto Github PK
View Code? Open in Web Editor NEW[Note: Not needed with VS Code anymore.] Forwards the host's ssh-agent into a Docker container on Windows and macOS hosts.
License: MIT License
[Note: Not needed with VS Code anymore.] Forwards the host's ssh-agent into a Docker container on Windows and macOS hosts.
License: MIT License
Nice, could you offer installation view homebew (https://brew.sh) too please? Thx!
I have a Dockerfile with an entrypoint script that expects the agent to be forwarded. But it does not work in the entrypoint when I run the container. It works when I run the same afterwards from the shell.
docker run -it mydockerimage sh
Error connecting to agent: No such file or directory
- thats from the entrypoint
But when the shell opens
# ssh-add -l
3072 SHA256:BLAHBLAHBLAH mylogin (RSA)
#
EDIT: Adding some sleep into the entrypoint helped. Would be nice if it somehow waited automatically if possible
BTW thanks a lot for this package
Typically my dev containers run as a non-root user in VSCode and when trying to interact with the agent, I get Permission Denied.
Both ssh-add -l
and simply using ssh get permission denied when interacting with the agent. The /tmp/.ssh-auth-sock
permissions are srwxr-xr-x root:rooot
. If I run the same container as root with:
docker run -ti --rm -e SSH_AUTH_SOCK=/tmp/.ssh-auth-sock -l com.ensody.ssh-agent-inject= --entrypoint=/bin/bash vsc-mw-docker-base-image-updater-integration-393441b99ce096875fdf31c15bd6ca7f-uid
I can use the agent socket just fine.
During a docker build which requires a RUN with --mount=type=ssh
, I end up with the error below printed by ssh-agent-inject process.
Error fetching containers error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/containers/json?filters=%7B%22label%22%3A%7B%22com.ensody.ssh-agent-inject%22%3Atrue%7D%7D&limit=0: dial unix /var/run/docker.sock: socket: too many open files
The installer should make ssh-agent-inject run in the background after login.
Package manager integration (e.g. Brew, deb, rpm) would be great.
I'm getting this error on macOS Mojave 10.14.6 when trying to install php composer dependencies from private repositories while building a docker image with ssh-agent-inject support.
173860a65acb7d82ba855ab25069a8fb890f6a0be9412bab63d5ca0bba087eb8 Copy from agent to sock failed: read unix ->/private/tmp/com.apple.launchd.FLrERP3sdn/Listeners: use of closed network connection
The same image builds properly on Ubuntu 18.04
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.