Created
July 17, 2018 11:06
-
-
Save YanhaoYang/72cf38877f073d096a96ec0e9f85cded to your computer and use it in GitHub Desktop.
Docker compose with ssh-agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
postgres: | |
image: postgres:9.6 | |
ports: | |
- "5432:5432" | |
environment: | |
POSTGRES_PASSWORD: a | |
web: | |
image: yanhao/ruby-dev:2.5.0 | |
hostname: web.dev | |
ports: | |
- "8000:8000" | |
working_dir: /home/docker/src | |
volumes: | |
- ./src/web:/home/docker/src | |
- ./tmp:/home/docker/.zsh_histories | |
- "${HOME}/.vbuf:/home/docker/.vbuf" | |
volumes_from: | |
- ssh-agent | |
environment: | |
- HISTFILE=/home/docker/.zsh_histories/.zsh_history | |
- PG_URL=postgres://postgres:a@postgres/veh | |
- SSH_AUTH_SOCK=/.ssh-agent/proxy-socket | |
- GIT_AUTHOR_NAME=Yanhao Yang | |
- [email protected] | |
- GIT_COMMITTER_NAME=Yanhao Yang | |
- [email protected] | |
ssh-agent: | |
image: yanhao/ssh-agent # docker run --rm --volumes-from=x_ssh-agent_1 -v ~/.ssh:/.ssh -it yanhao/ssh-agent:latest ssh-add /root/.ssh/id_rsa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment