Adds documentation of building and using our dev container.

This commit is contained in:
2026-01-27 07:05:56 -08:00
parent 815f865060
commit 014402d3cc
3 changed files with 212 additions and 39 deletions

View File

@@ -16,8 +16,32 @@ Complete Docker/Podman container for Nintendo 3DS homebrew development with full
## Quick Start
### Building the Container
### Using Helper Scripts (Recommended)
The easiest way to use these containers is with the provided helper scripts:
**1. Build the container:**
```bash
./scripts/build-container.sh 3ds
```
**2. Open interactive shell:**
```bash
# Current directory
./scripts/container-shell.sh
# Specific project
./scripts/container-shell.sh ~/my-3ds-game
# With additional volumes or environment
./scripts/container-shell.sh ~/my-game -v /data:/data:z -e DEBUG=1
```
### Manual Container Usage
If you prefer to use podman/docker commands directly:
**Building the Container:**
```bash
# Using Podman (recommended for rootless operation)
podman build -t tomusan/devkitarm-3ds:latest -f docker/3ds.Dockerfile .
@@ -28,31 +52,101 @@ docker build -t tomusan/devkitarm-3ds:latest -f docker/3ds.Dockerfile .
Build time: ~10-15 minutes on first build (downloads and compiles bannertool, makerom, ctrtool)
### Compiling a 3DS Project
**Compiling a 3DS Project:**
**Basic compilation** (produces .3dsx homebrew file):
Basic compilation (produces .3dsx homebrew file):
```bash
podman run --rm -v ./your-project:/project:z tomusan/devkitarm-3ds:latest make
```
**With CIA file creation**:
With CIA file creation:
```bash
# Most 3DS projects with proper Makefile configuration
podman run --rm -v ./your-project:/project:z tomusan/devkitarm-3ds:latest make
```
**Clean and rebuild**:
Clean and rebuild:
```bash
podman run --rm -v ./your-project:/project:z tomusan/devkitarm-3ds:latest bash -c "make clean && make"
```
### Interactive Shell
**Interactive Shell:**
For debugging or manual builds:
```bash
podman run -it --rm -v ./your-project:/project:z tomusan/devkitarm-3ds:latest bash
```
## Helper Scripts
### build-container.sh
Builds and tags development containers with automatic runtime detection (podman/docker).
**Usage:**
```bash
./scripts/build-container.sh <platform> [version]
```
**Examples:**
```bash
# Build with default version (0.1.0)
./scripts/build-container.sh 3ds
# Build with custom version
./scripts/build-container.sh 3ds 0.2.0
# Show help
./scripts/build-container.sh --help
```
**Features:**
- Auto-detects podman/docker runtime
- Validates semantic versioning (X.Y.Z format)
- Tags both version and latest
- Colored output with build status
- Shows usage examples after successful build
**Environment Variables:**
- `CONTAINER_RUNTIME` - Override runtime (podman or docker)
### container-shell.sh
Opens an interactive bash shell in the development container with your project mounted.
**Usage:**
```bash
./scripts/container-shell.sh [project-path] [podman-args...]
```
**Examples:**
```bash
# Shell in current directory
./scripts/container-shell.sh
# Shell in specific project
./scripts/container-shell.sh ~/my-3ds-game
# With additional volume mount
./scripts/container-shell.sh ~/my-game -v /data:/data:z
# With environment variable
./scripts/container-shell.sh ~/my-game -e DEBUG=1
# Multiple extra arguments
./scripts/container-shell.sh ~/my-game -v /data:/data:z -e DEBUG=1 --network=host
```
**Features:**
- First argument = project path (defaults to current directory)
- All additional arguments passed to podman/docker run
- Auto-detects podman/docker runtime
- Colored output with container information
- Project mounted at `/project` with working directory set
**Environment Variables:**
- `CONTAINER_RUNTIME` - Override runtime (podman or docker)
## Output Files
A complete 3DS build produces: