From 8d47f762dc6573193cef8f814af7ccdaaf7efcd0 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Thu, 27 Nov 2025 13:31:40 +0000 Subject: [PATCH] docs: enhance README with detailed descriptions and use cases for ht-docker-tools --- readme.md | 212 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 132 insertions(+), 80 deletions(-) diff --git a/readme.md b/readme.md index b0dff97..061b26a 100644 --- a/readme.md +++ b/readme.md @@ -1,85 +1,96 @@ -# ht-docker-tools +# 🐳 ht-docker-tools -Docker images for various tools (MongoDB, MinIO, ClickHouse, Caddy, Redis) enhanced with Deno runtime support. +**Production-ready Docker images for MongoDB, MinIO, ClickHouse, Caddy, and Redis β€” supercharged with Deno and Node.js runtimes.** -## Available Images +These images let you run your favorite infrastructure tools alongside modern JavaScript/TypeScript tooling. Whether you need to script database migrations, automate object storage, or run custom health checks β€” you're covered. + +## Issue Reporting and Security + +For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly. + +--- + +## 🎯 Why ht-docker-tools? + +- **Scripting-Ready**: Every image includes Deno for running TypeScript scripts directly in containers +- **Two Flavors**: Choose official base images (minimal changes) or Alpine images (lightweight with full Node.js/NVM support) +- **Multi-Arch**: Full support for `linux/amd64` and `linux/arm64` (Apple Silicon friendly) +- **CI/CD Optimized**: NVM works out of the box in GitHub Actions, GitLab CI, and any `docker exec bash -c` workflow + +--- + +## πŸ“¦ Available Images ### Official Base Images -These images extend official Docker images with Deno runtime: +Extend official Docker images with Deno runtime. Ideal for production with existing configurations. -| Image | Base | Description | -|-------|------|-------------| -| `ht-docker-tools:clickhouse` | clickhouse/clickhouse-server | ClickHouse + Deno | -| `ht-docker-tools:mongodb` | mongo:latest | MongoDB + Deno | -| `ht-docker-tools:minio` | minio/minio:latest | MinIO + Deno | -| `ht-docker-tools:caddy` | caddy:latest | Caddy + Deno | -| `ht-docker-tools:redis` | redis:latest | Redis + Deno | +| Image | Base | What's Added | +|-------|------|--------------| +| `ht-docker-tools:clickhouse` | `clickhouse/clickhouse-server` | + Deno | +| `ht-docker-tools:mongodb` | `mongo:latest` | + Deno | +| `ht-docker-tools:minio` | `minio/minio:latest` | + Deno | +| `ht-docker-tools:caddy` | `caddy:latest` | + Deno | +| `ht-docker-tools:redis` | `redis:latest` | + Deno | -### Alpine Images +### Alpine Images ⚑ -Lightweight Alpine-based images with full NVM + Node.js + Deno support: +Lightweight Alpine-based images with the full stack. Perfect for CI/CD and development. -| Image | Description | Size | -|-------|-------------|------| -| `ht-docker-tools:clickhouse-alpine` | ClickHouse + NVM + Node.js + Deno | ~250MB | -| `ht-docker-tools:mongodb-alpine` | MongoDB + NVM + Node.js + Deno | ~200MB | -| `ht-docker-tools:minio-alpine` | MinIO + NVM + Node.js + Deno | ~200MB | -| `ht-docker-tools:caddy-alpine` | Caddy + NVM + Node.js + Deno | ~200MB | -| `ht-docker-tools:redis-alpine` | Redis + NVM + Node.js + Deno | ~200MB | +| Image | Includes | Approx. Size | +|-------|----------|--------------| +| `ht-docker-tools:clickhouse-alpine` | ClickHouse + NVM + Node.js 20 + Deno | ~250MB | +| `ht-docker-tools:mongodb-alpine` | MongoDB + NVM + Node.js 20 + Deno | ~200MB | +| `ht-docker-tools:minio-alpine` | MinIO + NVM + Node.js 20 + Deno | ~200MB | +| `ht-docker-tools:caddy-alpine` | Caddy + NVM + Node.js 20 + Deno | ~200MB | +| `ht-docker-tools:redis-alpine` | Redis + NVM + Node.js 20 + Deno | ~200MB | -## Quick Start +--- -### Using Official Base Images +## πŸš€ Quick Start + +### Pull from Registry ```bash -# MongoDB with Deno scripting -docker run -d --name mongo ht-docker-tools:mongodb +# Official base images +docker pull code.foss.global/host.today/ht-docker-tools:mongodb +docker pull code.foss.global/host.today/ht-docker-tools:redis -# Execute Deno script inside container -docker exec mongo deno run --allow-net script.ts - -# Redis with Deno -docker run -d --name redis ht-docker-tools:redis +# Alpine images (recommended for most use cases) +docker pull code.foss.global/host.today/ht-docker-tools:mongodb-alpine +docker pull code.foss.global/host.today/ht-docker-tools:redis-alpine ``` -### Using Alpine Images +### Run with Deno Scripts ```bash -# MongoDB Alpine with Node.js and Deno -docker run -d --name mongo-alpine ht-docker-tools:mongodb-alpine +# Start MongoDB +docker run -d --name mongo code.foss.global/host.today/ht-docker-tools:mongodb -# Use Node.js -docker exec mongo-alpine bash -c "node --version" - -# Use Deno -docker exec mongo-alpine bash -c "deno --version" - -# Switch Node versions with NVM -docker exec mongo-alpine bash -c "nvm install 18 && nvm use 18 && node --version" +# Execute a Deno script inside the container +docker exec mongo deno run --allow-net --allow-read script.ts ``` -## Features +### Use Node.js with NVM (Alpine Images) -### Official Base Images -- Extend official Docker images (MongoDB, MinIO, ClickHouse, Caddy, Redis) -- Add Deno runtime for scripting and automation -- Preserve original image entrypoints and configurations -- Ideal for production use with existing configurations +```bash +# Start Redis Alpine +docker run -d --name redis code.foss.global/host.today/ht-docker-tools:redis-alpine -### Alpine Images -- Lightweight Alpine-based (significantly smaller than official images) -- Full NVM support for Node.js version switching -- Node.js LTS (20.18.2) pre-installed -- Deno runtime included -- Multi-architecture support (amd64/arm64) -- Ideal for CI/CD and development environments +# Check Node version +docker exec redis bash -c "node --version" +# v20.18.2 -## Docker Compose Example +# Switch Node versions on the fly +docker exec redis bash -c "nvm install 18 && nvm use 18 && node --version" +# v18.x.x +``` + +--- + +## πŸ”§ Docker Compose Example ```yaml -version: '3.8' - services: mongodb: image: code.foss.global/host.today/ht-docker-tools:mongodb-alpine @@ -127,27 +138,46 @@ volumes: caddy_config: ``` -## Building Images Locally +--- + +## πŸ› οΈ NVM in Docker β€” It Just Worksβ„’ + +NVM is notoriously tricky in Docker because it's a bash function, not a binary. These Alpine images solve this with a smart entrypoint that handles three contexts: + +| Context | How It Works | +|---------|--------------| +| **Dockerfile RUN** | Custom shell wrapper loads NVM before each command | +| **CI/CD `bash -c`** | Entrypoint detects and injects bashrc sourcing | +| **Interactive shells** | Standard bashrc initialization | + +```bash +# Works in CI/CD pipelines +docker exec mycontainer bash -c "nvm use 18 && npm install && npm test" + +# Works in Dockerfiles +FROM code.foss.global/host.today/ht-docker-tools:mongodb-alpine +RUN nvm install 18 && npm install -g typescript +``` + +--- + +## πŸ—οΈ Building Locally ```bash # Clone the repository git clone https://code.foss.global/host.today/ht-docker-tools.git cd ht-docker-tools -# Build all images -chmod +x build-images.sh +# Build all images (native architecture) ./build-images.sh # Test all images -chmod +x test-images.sh ./test-images.sh ``` -## Multi-Architecture Support +### Multi-Architecture Builds -All Alpine images support both `linux/amd64` and `linux/arm64` architectures. - -For CI/CD multi-arch builds: +For CI/CD pipelines pushing to registries: ```bash docker buildx build \ @@ -157,27 +187,49 @@ docker buildx build \ --push . ``` -## NVM Usage (Alpine Images) +--- -Alpine images include NVM for Node.js version management: +## πŸ“‹ Bundled Versions -```bash -# Check NVM version -docker run --rm ht-docker-tools:redis-alpine bash -c "nvm --version" +| Component | Version | +|-----------|---------| +| NVM | v0.40.1 | +| Node.js LTS | v20.18.2 | +| Deno | Latest (from Alpine edge/community) | -# Install specific Node.js version -docker run --rm ht-docker-tools:redis-alpine bash -c "nvm install 18 && node --version" +Alpine images use `unofficial-builds.nodejs.org` for musl-compatible Node.js binaries. -# Use in Dockerfile -FROM code.foss.global/host.today/ht-docker-tools:mongodb-alpine -RUN nvm install 18 && nvm use 18 && npm install -g typescript -``` +--- -## Registry +## 🎯 Use Cases -Images are available at: -- `code.foss.global/host.today/ht-docker-tools` +- **Database Migrations**: Run TypeScript migration scripts directly in your DB container +- **Health Checks**: Write sophisticated health probes in Deno +- **Scripted Backups**: Automate backup tasks with Node.js scripts +- **CI/CD Integration**: Execute tests that need both database and runtime +- **Local Development**: Single container with everything you need -## License +--- -MIT - Task Venture Capital GmbH +## License and Legal Information + +This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. + +**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file. + +### Trademarks + +This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH. + +### Issue Reporting and Security + +For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly. + +### Company Information + +Task Venture Capital GmbH +Registered at District court Bremen HRB 35230 HB, Germany + +For any legal inquiries or if you require further information, please contact us via email at hello@task.vc. + +By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.