Guest User

Untitled

a guest
Jan 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. FROM node:10
  2.  
  3. WORKDIR /usr/src/app
  4. COPY package*.json /usr/src/app
  5.  
  6. # install socat and ssh to talk to the host ssh-agent
  7. RUN apt-get update && apt-get install --quiet --yes socat \
  8. # create variable called SSH_AUTH_SOCK, ssh will use this automatically
  9. && mkdir -p /tmp \
  10. && export SSH_AUTH_SOCK=/tmp/auth.sock \
  11. # make SSH_AUTH_SOCK useful by connecting it to hosts ssh-agent over localhost:56789
  12. && /bin/sh -c "socat UNIX-LISTEN:${SSH_AUTH_SOCK},unlink-early,mode=777,fork TCP:host.docker.internal:56789 &" \
  13. # stuff I needed my ssh keys for
  14. && mkdir -p ~/.ssh \
  15. # add gitlab fingerprint to known hosts
  16. && ssh-keyscan gitlab.com >> ~/.ssh/known_hosts \
  17. # Execute the command you need SSH keys for
  18. && npm install
Add Comment
Please, Sign In to add comment