agentleFS
dreitagebartdreitagebart/skills/skills/containers/SKILL.md

containers

Skill0 starsChanged 16 days agoMITView on GitHub

dreitagebart container conventions - use Containerfile instead of Dockerfile, compose.yml instead of docker-compose.yml, multi-stage builds, base images in the order Red Hat UBI (including AlmaLinux/Fedora), Alpine, slim, and always set restart unless-stopped and container_name. Use for Containerfiles, Compose files, images, deployment, container builds, Podman or Docker, database containers, and containerizing an app.

  • Reads credentials

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use sql.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • thechandanbhagatSkill

    sql

    Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put .containerignore next to the Containerfile (Podman reads it, and Docker supports it for compatibility).

    line 12
  2. Very specific:

    Package management in UBI/Alma: Always use microdnf instead of dnf in *-minimal images and clean caches in the same RUN layer (microdnf …

    line 25
  3. Very specific:

    Do not guess tags: Check the tag in the registry (podman search, registry website) before adding it, then pin it exactly.

    line 26
  4. Very specific:

    Keep secrets out of the image: do not copy .env or pass secrets as ARG.

    line 28

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Container

File names

  • Containerfile, nie Dockerfile.
  • compose.yml, never docker-compose.yml. Do not use the obsolete version: key.
  • Put .containerignore next to the Containerfile (Podman reads it, and Docker supports it for compatibility).

Building images

  • Always use multiple stages: one for dependencies, one for building, and one lean runtime stage. Include only runtime artifacts in the runtime stage; exclude compilers and dev dependencies.
  • Basisimage-Reihenfolge:
    1. Red Hat UBI (registry.access.redhat.com/ubi9/..., or ubi10/... if needed), provided no login is required and the image stays lean:
      • Runtime stages: ubi9-micro (distroless, no package manager) or ubi9-minimal (when packages must be installed with microdnf).
      • Language runtimes/build stages: official UBI images such as ubi9/go-toolset, ubi9/python-312, or ubi9/nodejs-20.
      • RPM ecosystem fallback: If a required package is missing from the free UBI repositories, use AlmaLinux (almalinux:9-minimal) or Fedora (fedora-minimal).
    2. Alpine (*-alpine) when no suitable lean image exists in the Red Hat/RPM ecosystem.
    3. slim variants (*-slim) only when no Alpine image exists or Alpine (musl instead of glibc) demonstrably causes compatibility issues.
  • Bun has no official Red Hat image, so use oven/bun:<Version>-alpine, or -slim as a fallback.
  • Package management in UBI/Alma: Always use microdnf instead of dnf in *-minimal images and clean caches in the same RUN layer (microdnf clean all).
  • Do not guess tags. Check the tag in the registry (podman search, registry website) before adding it, then pin it exactly. Never use a floating tag such as latest.
  • Do not run as root: UBI images already include the unprivileged default user 1001 (USER 1001); the oven/bun image uses USER bun. For other images, create and set a non-root user explicitly.
  • Keep secrets out of the image: do not copy .env or pass secrets as ARG. Supply configuration at runtime through environment variables.

Templates: assets/Containerfile.bun-next (Next.js with Bun, standalone output) and assets/.containerignore.

The template requires output: 'standalone' in next.config.ts. With Prisma, run prisma generate in the build stage (see database). In a Turborepo, first create a lean workspace with turbo prune <app> --docker; adapt the template for each app.

Compose

For every service in compose.yml:

  • restart: unless-stopped
  • Set container_name: to a unique name, suggested pattern <project>-<service> (for example myproject-web).

Weitere Regeln:

  • Give databases (PostgreSQL) a named volume; do not bind-mount to unknown paths.
  • Choose the database major version deliberately and pin it in the tag.
  • Set build.dockerfile to Containerfile.
  • Supply credentials through env_file or secrets, never as plaintext in the Compose file.

The assets/compose.yml template is a placeholder; the user will provide the real Compose templates. Until then, apply the rules above, but ask before making stack decisions (reverse proxy, networks, health checks).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.