docs: enhance README with detailed descriptions and use cases for ht-docker-tools
This commit is contained in:
212
readme.md
212
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
|
### 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 |
|
| Image | Base | What's Added |
|
||||||
|-------|------|-------------|
|
|-------|------|--------------|
|
||||||
| `ht-docker-tools:clickhouse` | clickhouse/clickhouse-server | ClickHouse + Deno |
|
| `ht-docker-tools:clickhouse` | `clickhouse/clickhouse-server` | + Deno |
|
||||||
| `ht-docker-tools:mongodb` | mongo:latest | MongoDB + Deno |
|
| `ht-docker-tools:mongodb` | `mongo:latest` | + Deno |
|
||||||
| `ht-docker-tools:minio` | minio/minio:latest | MinIO + Deno |
|
| `ht-docker-tools:minio` | `minio/minio:latest` | + Deno |
|
||||||
| `ht-docker-tools:caddy` | caddy:latest | Caddy + Deno |
|
| `ht-docker-tools:caddy` | `caddy:latest` | + Deno |
|
||||||
| `ht-docker-tools:redis` | redis:latest | Redis + 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 |
|
| Image | Includes | Approx. Size |
|
||||||
|-------|-------------|------|
|
|-------|----------|--------------|
|
||||||
| `ht-docker-tools:clickhouse-alpine` | ClickHouse + NVM + Node.js + Deno | ~250MB |
|
| `ht-docker-tools:clickhouse-alpine` | ClickHouse + NVM + Node.js 20 + Deno | ~250MB |
|
||||||
| `ht-docker-tools:mongodb-alpine` | MongoDB + NVM + Node.js + Deno | ~200MB |
|
| `ht-docker-tools:mongodb-alpine` | MongoDB + NVM + Node.js 20 + Deno | ~200MB |
|
||||||
| `ht-docker-tools:minio-alpine` | MinIO + NVM + Node.js + Deno | ~200MB |
|
| `ht-docker-tools:minio-alpine` | MinIO + NVM + Node.js 20 + Deno | ~200MB |
|
||||||
| `ht-docker-tools:caddy-alpine` | Caddy + NVM + Node.js + Deno | ~200MB |
|
| `ht-docker-tools:caddy-alpine` | Caddy + NVM + Node.js 20 + Deno | ~200MB |
|
||||||
| `ht-docker-tools:redis-alpine` | Redis + NVM + Node.js + 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
|
```bash
|
||||||
# MongoDB with Deno scripting
|
# Official base images
|
||||||
docker run -d --name mongo ht-docker-tools:mongodb
|
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
|
# Alpine images (recommended for most use cases)
|
||||||
docker exec mongo deno run --allow-net script.ts
|
docker pull code.foss.global/host.today/ht-docker-tools:mongodb-alpine
|
||||||
|
docker pull code.foss.global/host.today/ht-docker-tools:redis-alpine
|
||||||
# Redis with Deno
|
|
||||||
docker run -d --name redis ht-docker-tools:redis
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using Alpine Images
|
### Run with Deno Scripts
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# MongoDB Alpine with Node.js and Deno
|
# Start MongoDB
|
||||||
docker run -d --name mongo-alpine ht-docker-tools:mongodb-alpine
|
docker run -d --name mongo code.foss.global/host.today/ht-docker-tools:mongodb
|
||||||
|
|
||||||
# Use Node.js
|
# Execute a Deno script inside the container
|
||||||
docker exec mongo-alpine bash -c "node --version"
|
docker exec mongo deno run --allow-net --allow-read script.ts
|
||||||
|
|
||||||
# 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"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Features
|
### Use Node.js with NVM (Alpine Images)
|
||||||
|
|
||||||
### Official Base Images
|
```bash
|
||||||
- Extend official Docker images (MongoDB, MinIO, ClickHouse, Caddy, Redis)
|
# Start Redis Alpine
|
||||||
- Add Deno runtime for scripting and automation
|
docker run -d --name redis code.foss.global/host.today/ht-docker-tools:redis-alpine
|
||||||
- Preserve original image entrypoints and configurations
|
|
||||||
- Ideal for production use with existing configurations
|
|
||||||
|
|
||||||
### Alpine Images
|
# Check Node version
|
||||||
- Lightweight Alpine-based (significantly smaller than official images)
|
docker exec redis bash -c "node --version"
|
||||||
- Full NVM support for Node.js version switching
|
# v20.18.2
|
||||||
- Node.js LTS (20.18.2) pre-installed
|
|
||||||
- Deno runtime included
|
|
||||||
- Multi-architecture support (amd64/arm64)
|
|
||||||
- Ideal for CI/CD and development environments
|
|
||||||
|
|
||||||
## 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
|
```yaml
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mongodb:
|
mongodb:
|
||||||
image: code.foss.global/host.today/ht-docker-tools:mongodb-alpine
|
image: code.foss.global/host.today/ht-docker-tools:mongodb-alpine
|
||||||
@@ -127,27 +138,46 @@ volumes:
|
|||||||
caddy_config:
|
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
|
```bash
|
||||||
# Clone the repository
|
# Clone the repository
|
||||||
git clone https://code.foss.global/host.today/ht-docker-tools.git
|
git clone https://code.foss.global/host.today/ht-docker-tools.git
|
||||||
cd ht-docker-tools
|
cd ht-docker-tools
|
||||||
|
|
||||||
# Build all images
|
# Build all images (native architecture)
|
||||||
chmod +x build-images.sh
|
|
||||||
./build-images.sh
|
./build-images.sh
|
||||||
|
|
||||||
# Test all images
|
# Test all images
|
||||||
chmod +x test-images.sh
|
|
||||||
./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 pipelines pushing to registries:
|
||||||
|
|
||||||
For CI/CD multi-arch builds:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
@@ -157,27 +187,49 @@ docker buildx build \
|
|||||||
--push .
|
--push .
|
||||||
```
|
```
|
||||||
|
|
||||||
## NVM Usage (Alpine Images)
|
---
|
||||||
|
|
||||||
Alpine images include NVM for Node.js version management:
|
## 📋 Bundled Versions
|
||||||
|
|
||||||
```bash
|
| Component | Version |
|
||||||
# Check NVM version
|
|-----------|---------|
|
||||||
docker run --rm ht-docker-tools:redis-alpine bash -c "nvm --version"
|
| NVM | v0.40.1 |
|
||||||
|
| Node.js LTS | v20.18.2 |
|
||||||
|
| Deno | Latest (from Alpine edge/community) |
|
||||||
|
|
||||||
# Install specific Node.js version
|
Alpine images use `unofficial-builds.nodejs.org` for musl-compatible Node.js binaries.
|
||||||
docker run --rm ht-docker-tools:redis-alpine bash -c "nvm install 18 && node --version"
|
|
||||||
|
|
||||||
# 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:
|
- **Database Migrations**: Run TypeScript migration scripts directly in your DB container
|
||||||
- `code.foss.global/host.today/ht-docker-tools`
|
- **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.
|
||||||
|
|||||||
Reference in New Issue
Block a user