deu/README.md
2025-05-01 12:34:35 +02:00

84 lines
2.0 KiB
Markdown

# DEU - Docker Environment Utility
A simple utility to create and manage development containers using Docker Compose.
## Overview
`deu` helps you quickly set up development environments in Docker containers. It creates a Docker Compose configuration and manages container states (start, stop, logs, etc.).
## Installation
```bash
chmod +x deu.py
sudo ln -s $(pwd)/deu.py /usr/local/bin/deu
```
## Usage
### Initialize a Container
Create a new development container:
```bash
# Local container (in current directory)
deu init --image ubuntu:24.04
# Global container (stored in ~/.config/deu/)
deu init -g --image ubuntu:24.04
# With custom service name
deu init --image ubuntu:24.04 --service my_container
```
### Manage Containers
All commands support both local and global containers:
```bash
# Activate container shell
deu activate # Use local container
deu activate my_container # Use specific container (local or global)
# Start container in background
deu background # Use local container
deu background my_container
# View container logs
deu logs # Use local container
deu logs my_container
# Stop container
deu stop # Use local container
deu stop my_container
# Remove container
deu rm # Use local container
deu rm my_container
# Stop and remove container (combines stop and rm)
deu delete # Use local container
deu delete my_container
# List all available containers
deu list # Shows both local and global containers
```
## Configuration
`deu` creates two configuration files:
1. `deu.toml` - Container configuration (local or in ~/.config/deu/)
2. `.container/docker-compose.yml` - Docker Compose configuration (local or in ~/.config/deu/.container_name/)
## Requirements
- Python 3.6+
- Docker
- Docker Compose
## Known Issues
### Python virtual envs
If you encounter a `ModuleNotFoundError: No module named 'yaml'` error when working within an environment, be sure to `pip install pyyaml` in that environment.