Skip to content

Instantly share code, notes, and snippets.

View rak16's full-sized avatar
🏠
Working from home

Ravish Ahmad rak16

🏠
Working from home
View GitHub Profile
@rak16
rak16 / generate_container_image.sh
Last active February 6, 2026 08:43
Simple script to generate container images. You can configure the total size and number of layers. The script generates a Dockerfile along with bin files, which can be then used to build an image. Note that the unit used is GB and not GiB.
#!/bin/bash
# Usage: ./generate_strict_gb.sh <TOTAL_GB_SI> <LAYER_COUNT> <OUTPUT_DIR>
TOTAL_GB=$1
LAYERS=$2
OUT_DIR=$3
if [ -z "$OUT_DIR" ]; then
echo "Usage: $0 <TOTAL_GB> <LAYERS> <OUTPUT_DIR>"
echo "Note: Uses strict SI Gigabytes (1 GB = 1,000,000,000 bytes)"