docker-ssh-agent-forward icon indicating copy to clipboard operation
docker-ssh-agent-forward copied to clipboard

Improve usability

Open Vanuan opened this issue 8 years ago • 0 comments

I think usability could be greatly improved here. Here's what I have in mind:

  1. User has a wrapper script for her project, run.sh
  2. User copies scripts from this project to her project.
  3. User modifies run.sh script to have this:
cd ssh-agent-forward
. ./ssh-agent-forward.sh
cd ..
docker-compose up ...
  1. User creates an ssh script ./docker/ssh_keys to be run inside a targeted docker container:
cat <<EOF >> ~/.ssh/config
Host *
User $SSH_USER
EOF
  1. User modifies docker-compose.yml to have this:
environment:
  SSH_AUTH_SOCK: $SSH_AUTH_SOCK
  SSH_USER: $USER # can override in docker-compose.override.yml
command: sh -c "./docker/ssh_keys"

For this to work, SSH forward script should run the thing (skip if it's already done) and export SSH_AUTH_SOCK variable.

Vanuan avatar Feb 08 '17 04:02 Vanuan