Sign inSign up

hieupth/debian

By hieupth

•Updated over 1 year ago

Image
0

204

hieupth/debian repository overview

⁠Debian Docker Image

A robust, minimal, and flexible Debian-based image with build-time hooks, optimized for modern DevOps workflows.


⁠» Overview

This project provides a Debian stable-slim image pre-configured with essential utilities and support for build-time hooks.
Designed for containerized environments, it enables seamless customization and extension through hook scripts.

  • Base Image: Debian stable-slim
  • Non-root User: nonroot (for enhanced container security)
  • Tags: Flexible tags with different package sets

⁠» Available Tags & Packages

TagIncluded Packages
nonetini, curl, gnupg, libcap2-bin
develbuild-essential, gcc, g++, make, cmake

⁠» Quickstart

Pull the image:

docker pull hieupth/debian:[tag]

Start a container with all hooks enabled:

docker run -e ENABLE_ALL_HOOKS=true hieupth/debian:[tag]

Run container with selective hooks (example):

docker run -e ENABLE_ROOT_HOOKS="01-packages 02-pip_install" hieupth/debian:[tag]

Switch to root (if needed):

USER root
# Install additional packages
apt-get update && apt-get install -y your-package

Switch back to non-root:

USER nonroot

⁠» Hook System

This image supports build-time hooks to customize the image during build phase.

  • Hook Directories:

    /hooks.d/
      ├── root/
      │     ├── 01-packages.sh
      │     └── 02-custom-setup.sh
      └── nonroot/
            ├── 01-app-setup.sh
            └── 02-entrypoint.sh
    
  • Naming Convention: NN-description.sh to ensure execution order.

  • Execution Flow:

    • hooks.sh handles hook discovery and execution based on user context (root or nonroot).
    • Hooks are controlled via environment variables.

⁠» Environment Variables

VariableDescription
ENABLE_ALL_HOOKSRun all hooks for both root and nonroot.
ENABLE_ALL_ROOT_HOOKSRun all root hooks.
ENABLE_ALL_NONROOT_HOOKSRun all nonroot hooks.
ENABLE_ROOT_HOOKSSpace-separated list of root hook script names (without .sh).
ENABLE_NONROOT_HOOKSSpace-separated list of nonroot hook script names (without .sh).
DEBIAN_PACKAGESSpace-separated list of Debian packages to install.
HOOKS_DIRDirectory containing hook scripts (default: /hooks.d).

⁠» Best Practices

✅ Use the non-root user (nonroot) for app runtime to enhance container security.
✅ Keep hook scripts idempotent to ensure safe repeated builds.
✅ Modularize each hook script for maintainability and reusability.
✅ Adopt semantic versioning for tags to ensure consistent CI/CD processes.
✅ Document any non-default configurations for easy onboarding.


⁠» Contributing

Contributions are welcome! Please follow the coding standards:

  • Write idempotent, testable, and modular hooks.
  • Follow semantic commit conventions.
  • Ensure your changes do not break existing workflows.

⁠» License

GNU AGPL v3.0⁠
© 2025 Hieu Pham⁠. All rights reserved.


Tag summary

Content type

Image

Digest

sha256:6d931cd6e…

Size

32.7 MB

Last updated

over 1 year ago

docker pull hieupth/debian