Skip to content

infocyph/docker-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ› οΈ Docker Tools Container

Docker Publish License: MIT Base: Alpine

A lightweight, multi-tool Docker image with SSL automation, Docker diagnostics and CLI utilities β€” designed for development and debugging workflows.


πŸ“¦ Available on Registries

Registry Image Name
Docker Hub docker.io/infocyph/tools
GitHub Container ghcr.io/infocyph/tools

πŸš€ Features

  • Lightweight Alpine-based container
  • Auto-generates trusted development certificates using mkcert
  • Supports server and client certificate generation
  • Wildcard domain certs via virtual host file scanning
  • Includes tools like curl, git, openssl, nmap, jq, tree, and ncdu
  • Interactive Docker TUI via lazydocker
  • Host volumes supported for cert persistence and dynamic vhost domain input
  • Bundles .p12 client certificates
  • Set timezone via environment variable TZ

πŸ› οΈ Preinstalled Utilities

Tool Purpose
mkcert Generate local CA-signed SSL certs
mkhost Generate nginx, apache host configuration
openssl Certificate inspection, bundling
lazydocker TUI-based Docker management
curl/wget Web endpoint testing
jq JSON manipulation
nmap Network scanner
net-tools IP, ARP, routing, and ifconfig commands
ncdu Disk usage visualizer
tree Directory structure visualizer
bash, coreutils POSIX compatibility and scripting

πŸ”§ How It Works

On container startup, the included certify.sh script:

  1. Scans all *.conf files under /etc/share/vhosts/**
  2. Extracts domain names from filenames
  3. Adds wildcard versions automatically
  4. Generates server and client certificates using mkcert

πŸ“ Domain Detection by Filename

The script looks for .conf files in any subdirectory under /etc/share/vhosts.

Filename β†’ Domains:

File Name Domains Generated
test.local.conf test.local, *.test.local
example.com.conf example.com, *.example.com
internal.dev.site.conf internal.dev.site, *.internal.dev.site

Additionally added automatically:

  • localhost
  • 127.0.0.1
  • ::1

πŸ“¦ Example: Docker Compose Integration

services:
  certgen:
    image: infocyph/docker-tools
    container_name: docker-tools
    volumes:
      - ../../configuration/apache:/etc/share/vhosts/apache:ro
      - ../../configuration/nginx:/etc/share/vhosts/nginx:ro
      - ../../configuration/ssl:/etc/mkcert
      - ../../configuration/rootCA:/etc/share/rootCA
      - /var/run/docker.sock:/var/run/docker.sock

πŸ“ This container can run as a one-shot cert generator or as a long-lived utility box.


πŸ” Generated Files

Certificate Type Files Generated
Apache (Server) apache-server.pem, apache-server-key.pem
Apache (Client) apache-client.pem, apache-client-key.pem
Nginx (Server) nginx-server.pem, nginx-server-key.pem
Nginx (Proxy) nginx-proxy.pem, nginx-proxy-key.pem
Nginx (Client) nginx-client.pem, nginx-client-key.pem, nginx-client.p12

πŸ›‘οΈ All generated certs are placed in /etc/mkcert.


πŸ“œ Example Manual Run

docker run --rm -it \
  -v $(pwd)/configuration/apache:/etc/share/vhosts/apache:ro \
  -v $(pwd)/configuration/nginx:/etc/share/vhosts/nginx:ro \
  -v $(pwd)/configuration/ssl:/etc/mkcert \
  infocyph/tools

πŸ”Ž Lazydocker Usage

docker exec -it docker-tools lazydocker

Make sure /var/run/docker.sock is mounted.


πŸ“ License

Licensed under the MIT License
Β© infocyph, abmmhasan


πŸ’¬ Feedback / Issues

Encountered a problem or want to suggest a feature?
Open an issue or start a discussion!