All StackShield tool images use kalilinux/kali-rolling as the base. Kali provides the security tooling ecosystem and a rolling Debian base that keeps tools up to date.
- Combine all
apt-getinstalls into a singleRUNlayer and clean the package cache in the same layer:RUN apt-get update && apt-get install -y --no-install-recommends \ <package1> \ <package2> \ && rm -rf /var/lib/apt/lists/* - Always use
--no-install-recommendsto keep image size down.
- Install binaries from GitHub releases when not available in apt, or when a specific version must be pinned.
- Pin to a specific release version (e.g.
v2.6.6) for reproducible builds. - Download, extract, chmod, and clean up the archive in a single
RUNlayer. - Install binaries to
/usr/local/bin/.
- Install
uvvia pip:pip3 install uv --break-system-packages - Copy
pyproject.tomlbefore source code so the dependency layer is cached independently. - Run
uv sync --frozento install dependencies into/app/.venv. - Add the venv to PATH:
ENV PATH="/app/.venv/bin:$PATH"sopythonresolves withoutuv run.
WORKDIR /app — all source code is copied here. Python imports resolve from /app as the root.
ssx.shalways passes--rm— containers are ephemeral.- No
ENTRYPOINTorCMD— the full invocation is provided byssx.sh. - Do not run as root unless a specific tool requires it. Document any exception.
After changing pyproject.toml or Dockerfile: docker build -t stackshield .
Code-only changes reuse the cached dependency layer automatically.