🚧 Work in Progress 🚧
.dodenv
is a Python-based script designed to create a DevContainer-like environment for
development projects. It automates building and running Docker containers, providing a
seamless development experience.
.dodenv
simplifies containerized development by:
- Building a Docker image from a specified Dockerfile.
- Running a container and attaching the terminal to an interactive bash session.
- Removing the container upon exit.
- Supporting multiple terminals attaching to the same container.
- Allowing selection of different Dockerfiles and passing additional
docker run
arguments.
This repository can be cloned into any project, and multiple Dockerfiles can be managed
using .dodenv
. By default, a Dockerfile
is provided, which installs Neovim and tmux along
with my custom configuration inside the container.
- Python 3
- Docker Engine
Different Dockerfiles can be used for various project setups. Below are some available variants:
- Dockerfile (default): Installs Neovim 10.4 and tmux with my custom configurations and some additional utilities.
- Dockerfile.ESP-IDF: Builds ESP-IDF v5.4 for ESP-based development.
- Clone this repository inside your project:
git clone https://github.com/TomOdw/.dodenv.git .dodenv
- Create a custom Dockerfile or modify the default one (e.g.,
Dockerfile.MY_CUSTOM
). - Run the following command to start the container using the default Dockerfile:
To use a custom Dockerfile:
sudo ./.dodenv/dodenv.py run
sudo ./.dodenv/dodenv.py run MY_CUSTOM
- Optionally, pass arguments to
docker run
, for example:sudo ./.dodenv/dodenv.py run MY_CUSTOM --device=/dev/tty0
Each execution of the run
command attaches the terminal to a bash session inside the container.
If executed in another terminal, a new bash session opens within the same container.
.dodenv
leverages Docker's caching mechanism for efficiency. If the Dockerfile changes, the
container is stopped, removed, and recreated to reflect the updates.
Tipp: If you are using tmux, try my plugin projactions.
Add a project specific .dodenv
run
command to the Environment
keybind, to easily start dodenv.
To stop and remove the container along with its associated Docker image (while keeping the cache intact), run:
sudo python3 .dodenv/dodenv.py delete
To delete and immediately recreate the environment, run:
sudo python3 .dodenv/dodenv.py reset
This effectively executes delete
followed by run
, ensuring the latest configuration is applied.
For contributions, issues, or feature requests, feel free to open an issue or submit a pull request. 🚀