Skip to content

Run As User: docker run

Michael Kenney edited this page Mar 17, 2018 · 6 revisions

A simple docker run solution for accessing private repositories via public key authentication that works for most use-cases.

The /home/dev/.ssh volume is used in linux environments with a local Docker daemon running as root.

The /root/.ssh volume is used in Docker for Mac (and I assume similar) environments.

$ docker run --rm -it \
    -v $(pwd):/src:rw \
    -v $HOME/.ssh:/home/dev/.ssh:ro \
    -v $HOME/.ssh:/root/.ssh:ro \
    mkenney/npm:node-8-alpine npm install

About the run-as-user script

Public key access to private repositories

Specify UID and GID values

Override the run-as-user script entirely

Clone this wiki locally