-
Notifications
You must be signed in to change notification settings - Fork 28
Run As User: Compose
Michael Kenney edited this page Mar 17, 2018
·
8 revisions
A simple docker-compose
dev build solution for accessing private repositories via public key authentication that works for most use-cases. The important point is that the ~/.ssh
directory is mounted into both the dev
and root
user's home directories.
version: '3'
services:
httpd:
container_name: "http"
image: nginx
volumes:
- .:/var/www/html/
npm:
container_name: "http.npm"
image: mkenney/npm:node-8-alpine
stdin_open: true
tty: true
command: ["npm", "install"]
volumes:
- .:/src
# Used in linux environments with a local Docker daemon
# running as root
- ~/.ssh:/home/dev/.ssh:ro
# Used in Docker for Mac (and I assume similar) environments
- ~/.ssh:/root/.ssh:ro
About the run-as-user
script
Public key access to private repositories
Specify UID
and GID
values
Override the run-as-user
script entirely