Skip to content

rodrigoff/devenv-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rodrigoff/devenv

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.

How to run

docker run --rm -it rodrigoff/devenv

Binding the docker socket

On macOS:

-v /var/run/docker.sock:/var/run/docker.sock

On Windows:

-v //var/run/docker.sock:/var/run/docker.sock

Using git with a bind mount

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).

Running the ssh-agent

  1. Start the ssh-agent container
docker run -d --name ssh-agent rodrigoff/ssh-agent
  1. Add your ssh keys
docker run --rm -it --volumes-from ssh-agent -v ~/.ssh:/.ssh rodrigoff/ssh-agent ssh-add /root/.ssh/id_rsa
  1. 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

About

Docker-based dev environment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages