Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM node:10
- WORKDIR /usr/src/app
- COPY package*.json /usr/src/app
- # install socat and ssh to talk to the host ssh-agent
- RUN apt-get update && apt-get install --quiet --yes socat \
- # create variable called SSH_AUTH_SOCK, ssh will use this automatically
- && mkdir -p /tmp \
- && export SSH_AUTH_SOCK=/tmp/auth.sock \
- # make SSH_AUTH_SOCK useful by connecting it to hosts ssh-agent over localhost:56789
- && /bin/sh -c "socat UNIX-LISTEN:${SSH_AUTH_SOCK},unlink-early,mode=777,fork TCP:host.docker.internal:56789 &" \
- # stuff I needed my ssh keys for
- && mkdir -p ~/.ssh \
- # add gitlab fingerprint to known hosts
- && ssh-keyscan gitlab.com >> ~/.ssh/known_hosts \
- # Execute the command you need SSH keys for
- && npm install
Add Comment
Please, Sign In to add comment