# Docker vs Binary Installation - Decision Rationale

**Reference**: [Web3Signer Docker Documentation](https://docs.web3signer.consensys.net/get-started/use-docker)

---

## Overview

Web3Signer offers two installation methods:
1. **Binary Distribution** (current approach)
2. **Docker Image** (alternative)

---

## Current Approach: Binary Installation in LXC Container

### Why We Chose Binary Installation

✅ **Simplicity**
- Direct installation, no additional layers
- No Docker daemon required
- Simpler systemd service management

✅ **LXC Container Compatibility**
- LXC containers are already configured and running
- Binary installation integrates naturally with LXC
- Direct file system access

✅ **Resource Efficiency**
- No container-in-container overhead
- Lower memory footprint
- Faster startup times

✅ **System Integration**
- Native systemd service support
- Direct log management via journalctl
- Standard Linux process management

✅ **Proxmox Integration**
- Works seamlessly with Proxmox LXC containers
- Uses standard Proxmox container management tools (`pct`)
- No additional virtualization layers

---

## Docker Alternative (Not Recommended for Our Use Case)

### Docker Installation Would Require

❌ **Additional Complexity**
- Install Docker daemon in LXC container
- Container-in-container setup (LXC → Docker)
- Docker daemon management and maintenance

❌ **Resource Overhead**
- Docker daemon requires additional memory
- Two layers of containerization
- More complex networking setup

❌ **Integration Challenges**
- Need to manage Docker containers within LXC
- More complex systemd integration
- Additional troubleshooting layers

❌ **Documentation Example**
```bash
docker run -p 9000:9000 consensys/web3signer:develop [options]
```
- Would need to adapt this for LXC environment
- Port mapping, volume mounting, etc. still needed
- Requires Docker runtime installation

---

## Comparison Summary

| Aspect | Binary (Current) | Docker |
|--------|-----------------|--------|
| Setup Complexity | ✅ Simple | ❌ More complex |
| Resource Usage | ✅ Lower | ❌ Higher |
| LXC Integration | ✅ Native | ⚠️ Container-in-container |
| Service Management | ✅ systemd | ⚠️ Docker + systemd |
| Maintenance | ✅ Standard Linux | ⚠️ Docker + LXC |
| Performance | ✅ Direct | ⚠️ Additional layer |

---

## Recommendation

**Continue with Binary Installation**

Our current approach (binary installation in LXC container) is optimal because:
1. We're already using LXC containers
2. Binary installation is simpler and more efficient
3. Better integration with existing infrastructure
4. Lower resource overhead
5. Standard Linux service management

---

## Current Status

- ✅ LXC container (VMID 107) created and running
- ✅ Java 21 installed (required for Web3Signer)
- ✅ Systemd service configured
- ✅ Network configuration complete (192.168.11.111:9000)
- ⏳ Waiting for Web3Signer binary download and transfer

---

## References

- [Web3Signer Binary Installation](https://docs.web3signer.consensys.net/get-started/install-binaries)
- [Web3Signer Docker Documentation](https://docs.web3signer.consensys.net/get-started/use-docker)
- Current Deployment: `DEPLOYMENT.md`
- Download Solution: `DOWNLOAD_SOLUTION.md`

---

## If Docker is Still Desired

If you still want to use Docker despite the recommendations above, the process would be:

1. Install Docker in LXC container 107:
   ```bash
   pct exec 107 -- bash -c 'apt-get update && apt-get install -y docker.io'
   ```

2. Run Web3Signer Docker container:
   ```bash
   pct exec 107 -- docker run -d \
     --name web3signer \
     -p 192.168.11.111:9000:9000 \
     -v /opt/web3signer/data:/data \
     consensys/web3signer:25.12.0 \
     --http-listen-port=9000 \
     --http-listen-host=0.0.0.0 \
     --data-path=/data
   ```

However, this adds unnecessary complexity for our use case.
