The goal of this repository is to keep my development environment inside Docker containers for easy portability and so I can have the same experience accross all the machines I work on without the hassle of setting everything up and keeping track of my dotfiles and stuff like that.
The base image is based on debian:stretch-slim
and contains the following:
There's also a ssh-agent container, based on nardeas/docker-ssh-agent image.
docker run --rm -it rodrigoff/devenv
On macOS:
-v /var/run/docker.sock:/var/run/docker.sock
On Windows:
-v //var/run/docker.sock:/var/run/docker.sock
To make git work correctly with bind mounted repositories (especially on Windows), we have to set the GIT_DISCOVERY_ACROSS_FILESYSTEM environment to true (export GIT_DISCOVERY_ACROSS_FILESYSTEM=true
or -e GIT_DISCOVERY_ACROSS_FILESYSTEM=true
when starting the container).
- Start the ssh-agent container
docker run -d --name ssh-agent rodrigoff/ssh-agent
- Add your ssh keys
docker run --rm -it --volumes-from ssh-agent -v ~/.ssh:/.ssh rodrigoff/ssh-agent ssh-add /root/.ssh/id_rsa
- Mount the ssh-agent socket in the desired containers
docker run -it --rm -v <your repos folder>:/workspace -e GIT_DISCOVERY_ACROSS_FILESYSTEM=true --volumes-from=ssh-agent -e SSH_AUTH_SOCK=/.ssh-agent/socket -v //var/run/docker.sock:/var/run/docker.sock -h devenv -p 22:22 rodrigoff/devenv