proofmode 0.9.0

Capture, share, and preserve verifiable photos and videos
Documentation
# ProofMode Docker Usage

This directory contains Docker-related files for ProofMode, a tool for capturing, sharing, and preserving verifiable photos and videos.

## Quick Start

### Using GitLab Container Registry

```bash
# Pull the latest image
docker pull registry.gitlab.com/guardianproject/proofmode/proofmode-rust:latest

# Run with local files
docker run -v /path/to/media:/app/input registry.gitlab.com/guardianproject/proofmode/proofmode-rust check /app/input/photo.jpg
```

### Building Locally

```bash
# Build for current architecture
docker build -t proofmode .

# Build multi-architecture image
docker buildx build --platform linux/amd64,linux/arm64 -t proofmode .
```

## Usage Examples

### Basic Commands

```bash
# Show help
docker run proofmode --help

# Check version
docker run proofmode --version

# Interactive shell
docker run -it proofmode bash
```

### Verify Media Files

```bash
# Check a single file
docker run -v $(pwd)/media:/app/input proofmode check /app/input/photo.jpg

# Check multiple files
docker run -v $(pwd)/media:/app/input proofmode check /app/input/*.jpg

# Check with verbose output
docker run -e RUST_LOG=debug -v $(pwd)/media:/app/input proofmode check /app/input/video.mp4
```

### Generate Proof Bundles

```bash
# Generate proof for a photo
docker run -v $(pwd)/media:/app/input -v $(pwd)/proofs:/app/output \
    proofmode generate /app/input/photo.jpg

# Generate with custom output directory
docker run -v $(pwd)/media:/app/input -v $(pwd)/custom-output:/app/output \
    -e PROOFMODE_OUTPUT_DIR=/app/output \
    proofmode generate /app/input/video.mp4

# Generate with PGP key
docker run -v $(pwd)/media:/app/input \
    -v $(pwd)/proofs:/app/output \
    -v $(pwd)/keys:/app/config \
    proofmode generate --pgp-key /app/config/my-key.asc /app/input/photo.jpg
```

### Using Docker Compose

```bash
# Start services
docker-compose up

# Run a command
docker-compose run proofmode check /app/input/photo.jpg

# Interactive shell
docker-compose run proofmode bash
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `PROOFMODE_INPUT_DIR` | Default input directory | `/app/input` |
| `PROOFMODE_OUTPUT_DIR` | Default output directory | `/app/output` |
| `PROOFMODE_CONFIG_DIR` | Configuration directory | `/app/config` |
| `RUST_LOG` | Logging level (error, warn, info, debug, trace) | `info` |

## Volume Mounts

The container expects the following volumes:

- `/app/input` - Input media files
- `/app/output` - Output proof bundles
- `/app/config` - Configuration and keys

## Security

- The container runs as a non-root user (uid 1000)
- Only necessary runtime dependencies are included
- Health checks ensure the service is responsive
- SSL certificates are included for HTTPS requests

## Multi-Architecture Support

ProofMode Docker images support the following architectures:

- `linux/amd64` - Intel/AMD 64-bit
- `linux/arm64` - ARM 64-bit (including Apple Silicon)

The correct architecture is automatically selected when pulling the image.

## Troubleshooting

### Permission Denied

If you get permission errors, ensure your local directories are accessible by uid 1000:

```bash
# Temporary fix
chmod -R 777 /path/to/media

# Better solution - match container user
chown -R 1000:1000 /path/to/media
```

### Out of Memory

For large media files, increase Docker memory limits:

```bash
docker run -m 4g proofmode generate /app/input/large-video.mp4
```

### SSL Certificate Errors

The container includes CA certificates. If you still have SSL issues:

```bash
docker run -v /etc/ssl/certs:/etc/ssl/certs:ro proofmode check https://example.com/photo.jpg
```

## Advanced Usage

### Custom Entrypoint

Override the entrypoint for advanced use cases:

```bash
docker run --entrypoint /bin/bash -it proofmode -c "proofmode --version && proofmode check /app/input/test.jpg"
```

### Network Configuration

Use Docker networks for service communication:

```bash
# Create network
docker network create proofmode-net

# Run with network
docker run --network proofmode-net proofmode check http://media-server/photo.jpg
```

### Resource Limits

Set CPU and memory limits:

```bash
docker run --cpus="2.0" --memory="2g" proofmode generate /app/input/video.mp4
```