A docker image with common dev dependencies installed such as git, nvm, python and a nice shell (ZSH) environment
It also contains an automated setup if you want to install these utilities into a machine rather than a container
This is based on my personal development preferences and is very opinionated
- Pre-configured ZSH
- Pre-configured tmux
- git
- wget
- asdf
- Nice default for vim
- Python build dependencies
- ag
- Common database drivers
To run it in a useful manner I'd suggest starting this image with
docker-compose
to make it sharing volumes and exposing ports
easier, as reference you can use this docker-compose.yaml file
If you just want to try the image, you can start it by running:
docker run -d --name dev sandman21dan/ready-dev-environment
Then to attach to it
docker exec -it dev zsh
To run with docker compose, I would recommend using a file similar to the one provided here so the home directory can be persisted after you stop or restart the container
The commands to run are the following:
docker-compose up -d
docker exec -it dev zsh
To get the automated setup running locally, Ansible
must already be installed, check
here for a guide
To run locally run the following commands:
ansible-galaxy collection install community.general
ansible-playbook --connection=local --inventory 127.0.0.1, index.yaml
For WSL:
ansible-galaxy collection install community.general
ansible-playbook --connection=local --inventory 127.0.0.1, index.yaml --extra-vars "wsl=true"
There's some variables that can be used to customise what gets installed or for which OS
-
sql_server_deps
: defaultfalse
Whether to install MS SQL Server drivers Linux only
-
python_version
: defaultlatest
-
skip_install_python
: defaultfalse
-
node_version
: defaultlatest
-
skip_install_node
: defaultfalse
-
os
: defaultlinux
Options are
linux
andmacos
-
wsl
: defaultfalse
WSL toggle, adds scripts for pbcopy and pbpaste that work between wsl2 and the Windows clipboard
For usage in MacOS the following commands needs to be run:
ansible-galaxy collection install community.general
ansible-playbook --connection=local --inventory 127.0.0.1, index.yaml --extra-vars "os=macos"
currently apt
and brew
are the supported package managers but others can be easily swapped
Everything is built via an ansible playbook to make dependencies repeatable and consistent, this also achieves the ability to install these dependencies on a computer outside of docker, such as a server or your local development PC/mac
I created this after hearing about the upcoming WSL 2 being a big time user of the current iteration of the WSL and got inspired into creating a VM based (VM through docker on Windows) so I could have an idea of how the WSL 2 would work in terms of performance and usability
Turns out this is actually quite usable, portable and takes very little time to set up!
By using the compose file you can quickly add more volumes you'd want to share with your host computer or open ports for projects you might be running inside your container (like web-servers or such)