Getting Started

Clone the repo, install prerequisites, and run your first demo in under 10 minutes.

Time required: ~10 minutes for setup, then 5-15 minutes per demo. Most demos need only podman. No Kubernetes cluster required.

1. Clone the Repository

Terminal
git clone https://github.com/patterncatalyst/spring-boot-optimization.git
cd spring-boot-optimization

2. Install Prerequisites

Every demo runs in containers — you do not need to install Java locally (though it helps for inspection). The minimum set:

Fedora / RHEL

sudo dnf install -y podman git python3
pip install podman-compose --user

macOS

brew install podman git python3
podman machine init --memory 8192 --cpus 4
podman machine start
pip3 install podman-compose

For demos 04, 08, and 09 (JDK 25), the container handles everything — no local JDK 25 installation needed. For the full tool list, see the Prerequisites page.

3. Verify Your Setup

Verify Podman
# Podman should report version 4.x or 5.x
podman --version

# Run a quick test container
podman run --rm registry.access.redhat.com/ubi9/openjdk-21:latest java -version

# Verify podman-compose
podman-compose --version
SELinux note (Fedora/RHEL): All bind mounts in demo compose files use the :Z suffix for SELinux relabeling. If you see "permission denied" errors on mounted volumes, ensure you're running the provided compose files — they handle this automatically.

4. Run Your First Demo

Start with Demo 01 — it's self-contained, takes 2 minutes, and demonstrates the foundational container-aware JVM configuration that every other demo builds on.

Demo 01: Container-Aware Heap Sizing
cd spring-boot-demos/demo-01-heap-sizing
chmod +x demo.sh
./demo.sh

The script builds two container images (one misconfigured, one correct) and runs them side-by-side so you can see the difference in heap behavior. Watch for:

5. Next Steps