Hardened Debian 13 (trixie-slim) Gitea + OpenSSH image, SHA-256 verified, daily CVE-scanned.
2.3K
A hardened, drop-in Gitea container image on Debian 13 (trixie-slim) compiling the official SHA-256-verified Gitea source release with the latest stable Go toolchain and security-patched Go dependencies alongside OpenSSH, git, sqlite3, and GITEA__* environment configuration support, maintained by Daniel G. Cosenza from FNX Labs.
dgcosenza/giteaghcr.io/dgcosenza/gitea (identical signed multi-arch digest)dgcosenza/gitea-dockergo-gitea/gitea (MIT License)LICENSE and THIRD-PARTY-NOTICES.md)dgcosenza/gitea provides a drop-in replacement for the official Alpine-based gitea/gitea image on fully upgraded Debian 13 (trixie-slim):
/data & env compatibility: Preserves /data/gitea, /data/git, /data/ssh, USER_UID/USER_GID (default 1000:1000, user git), OpenSSH on port 22, HTTP on port 3000, GITEA__SECTION__KEY (and *_FILE) environment overrides via a static environment-to-ini binary, and /api/healthz healthchecks.tini as PID 1, executes gitea web as non-root git via setpriv (fully compatible with security_opt: no-new-privileges:true), disables SSH password/root login, and ships an up-to-date Debian 13 CA certificate bundle.--no-cache, upgrades all Debian 13 packages (including OpenSSH, Git, OpenSSL, and CA certificates), tracks the latest official go-gitea/gitea release with SHA-256 verification, and enforces 0 fixable findings of any severity in both Trivy and Grype.| Component | Resolved Version |
|---|---|
| Gitea | 28.4.0 |
| Base OS | Debian 13.8 (trixie-slim) |
| Architectures | linux/amd64, linux/arm64 |
| Uncompressed size (per arch) | amd64: 128.8 MB, arm64: 363.9 MB |
| Last verified build (UTC) | 2026-11-28 |
| Published multi-arch digest | dgcosenza/gitea@sha256:74e36170d5043f44f75d6dafff95e44da70ce23e9c17774888f291d0564be705 |
| GHCR mirror | ghcr.io/dgcosenza/gitea@sha256:74e36170d5043f44f75d6dafff95e44da70ce23e9c17774888f291d0564be705 |
| Supply chain | Cosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance |
| Security gate (Trivy + Grype on SBOM) | 0 fixable findings of any severity (31 upstream-unfixed) |
| Tag | Policy | Description |
|---|---|---|
<version>-<YYYYMMDD> (e.g. 28.4.0-20261124) | Immutable | Date-stamped daily rebuild pinning the Gitea release and UTC build date. |
sha-<short> | Immutable | Packaging repository Git commit tag. |
<version> (e.g. 28.4.0) | Moving | Latest verified Debian 13 security rebuild of that Gitea release. |
latest | Moving | Latest verified build tracking the newest official Gitea release. |
Production pinning: Pin by registry digest:
image: dgcosenza/gitea:latest@sha256:<digest>
| Architecture | Status | Verification |
|---|---|---|
linux/amd64 | Published & natively tested | Built, smoke-tested, Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native x86_64 CI runners. |
linux/arm64 | Published & natively tested | Built, smoke-tested, Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native ARM64 CI runners. |
ghcr.io/dgcosenza/*), accompanied by automated signed GitHub Releases.docker rundocker run -d \
--name gitea \
--restart unless-stopped \
--security-opt no-new-privileges:true \
-p 192.0.2.10:3080:3000 \
-p 192.0.2.10:2223:22 \
-e USER_UID=1000 \
-e USER_GID=1000 \
-e TZ=Etc/UTC \
-e GITEA__database__DB_TYPE=sqlite3 \
-e GITEA__database__PATH=/data/gitea/gitea.db \
-e GITEA__server__START_SSH_SERVER=false \
-e GITEA__security__INSTALL_LOCK=true \
-v "$(pwd)/data:/data" \
dgcosenza/gitea:latest
See docker-compose.example.yml.
| Variable | Required | Default | Description |
|---|---|---|---|
USER | No | git | Non-root user executing Gitea and receiving SSH pushes. |
USER_UID / USER_GID | No | 1000 / 1000 | UID/GID assigned to USER at startup. |
TZ | No | Etc/UTC | Container timezone (prefer TZ env var over bind-mounting /etc/timezone). |
GITEA_WORK_DIR / GITEA_CUSTOM | No | /data/gitea | Gitea working and custom configuration directory. |
DISABLE_SSH | No | false | Set true to disable the container's OpenSSH daemon. |
GITEA__<SECTION>__<KEY> | No | (none) | Written automatically into ${GITEA_CUSTOM}/conf/app.ini at boot (__FILE suffix reads secret value from a file). |
| Path / Port | Mode / Owner | Purpose |
|---|---|---|
/data/gitea | USER_UID:USER_GID | conf/app.ini, SQLite gitea.db, attachments, avatars, packages, logs, sessions. |
/data/git | USER_UID:USER_GID | Git repositories, LFS storage, .ssh/authorized_keys. |
/data/ssh | 0:0 (0600 keys) | Persistent OpenSSH host keys (ed25519, rsa, ecdsa). |
3000/tcp | HTTP | Gitea web UI, Git HTTP, and OCI Container Registry. |
22/tcp | SSH | OpenSSH server for Git over SSH (GITEA__server__START_SSH_SERVER=false). |
HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=3 \
CMD ["sh", "-c", "wget -q -O - http://127.0.0.1:3000/api/healthz | grep -q pass || exit 1"]
Probes Gitea's /api/healthz endpoint and requires "status":"pass".
gitea/giteadocker exec -u git gitea gitea dump -c /data/gitea/conf/app.ini and back up ./data.image: gitea/gitea:... with image: dgcosenza/gitea:latest@sha256:<digest> keeping ./data:/data, USER_UID/USER_GID, and GITEA__* variables unchanged (remove any /etc/timezone file bind-mount if your host OS omits /etc/timezone and use TZ=... instead).docker compose up -d gitea), verify /api/healthz returns pass, and test both Git SSH and HTTP/registry endpoints.Every published digest (multi-arch index and per-architecture manifests) on both Docker Hub and GHCR is keyless-signed with Sigstore Cosign (GitHub OIDC), attested with SPDX and CycloneDX SBOMs, and backed by SLSA Build L3 provenance (actions/attest-build-provenance).
cosign verify \
--certificate-identity-regexp="^https://github\.com/dgcosenza/gitea-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/dgcosenza/gitea:latest
# Or against Docker Hub (identical digest):
cosign verify \
--certificate-identity-regexp="^https://github\.com/dgcosenza/gitea-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
dgcosenza/gitea:latest
cosign verify-attestation \
--type spdxjson \
--certificate-identity-regexp="^https://github\.com/dgcosenza/gitea-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/dgcosenza/gitea@sha256:<arch-digest>
gh attestation verify oci://ghcr.io/dgcosenza/gitea:latest --owner dgcosenza
--ignore-unfixed gate) and Grype (--only-fixed, severity cutoff negligible, blocking gate), and emits an SPDX SBOM (sbom.spdx.json) and provenance artifact.tini PID 1, no-new-privileges:true compatible via setpriv, OpenSSH restricted to AllowUsers git with key-only auth (PasswordAuthentication no, PermitRootLogin no).SECURITY.md.git clone https://github.com/dgcosenza/gitea-docker.git
cd gitea-docker
docker buildx build \
--platform linux/amd64 \
--load \
--build-arg BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--build-arg IMAGE_REVISION="$(git rev-parse HEAD)" \
-t dgcosenza/gitea:local \
.
| Build Arg | Default | Purpose |
|---|---|---|
GITEA_VERSION | 28.4.0 | Official go-gitea/gitea release version (SHA-256 verified, overridden daily by CI). |
GO_VERSION | 1.27.4 | Go toolchain used to compile Gitea and the static environment-to-ini helper. |
DEBIAN_BASE | debian:trixie-slim | Base OS image. |
.github/workflows/daily.yml runs automatically every day at 05:05 UTC, on pushes to main, on pull requests (verification only), and via workflow_dispatch. Every scheduled run executes a seven-step automated pipeline (gated by .github/workflows/public-check.yml):
go-gitea/gitea latest release via the authenticated GitHub API, resolves the latest stable Go toolchain and debian:trixie-slim digest, diffs against versions.json, and emits upstream-changes.md.linux/amd64 and linux/arm64 natively with --no-cache on schedule, verifies the official Gitea source tarball SHA-256, updates vulnerable Go modules and compiles Gitea with the latest stable Go toolchain (bindata timetzdata), upgrades Debian 13 packages (apt-get update && apt-get -y upgrade), and emits SPDX and CycloneDX SBOMs plus provenance attestations.--ignore-unfixed gate) and Grype (blocking --only-fixed gate, severity cutoff negligible), diffs findings against the previous scan, and retains reports for 90 days.tests/smoke.sh to verify Gitea version, tini PID 1, non-root git process, OpenSSH banner on port 22, GITEA__* INI rendering, /api/healthz pass, and a negative closed-port check.latest, <version>, <version>-<YYYYMMDD>, and sha-<short> tags to Docker Hub and records the immutable digest.versions.json, the README Current Versions block, and a dated CHANGELOG.md entry via github-actions[bot] with [skip ci] when content changes, then syncs the Docker Hub overview via peter-evans/dockerhub-description.ci-failure with the failing job and run link, and auto-closes it on the next green run.trixie-slim) instead of upstream Alpine: Upstream's official Docker image uses Alpine; migrating to Debian 13 (trixie-slim) standardizes glibc, OpenSSL 3, OpenSSH, and CA certificate security updates across the stack and eliminates Alpine libxml2/musl packaging lag.gitea-src-<version>.tar.gz archive (which ships prebuilt frontend assets) with the latest stable Go toolchain and up-to-date Go security fixes (such as github.com/klauspost/compress, github.com/go-chi/chi/v5, and golang.org/x/crypto), preventing prebuilt-binary transitive CVEs from blocking releases while preserving full GITEA__SECTION__KEY and *_FILE drop-in compatibility via our static Go environment-to-ini helper.This repository follows a clear packaging-vs-upstream license split:
packaging: MIT): Licensed under the MIT License — copyright Daniel G. Cosenza from FNX Labs.go-gitea/gitea) (upstream: MIT): Gitea is licensed under the MIT License (go-gitea/gitea).Full third-party notices are maintained in THIRD-PARTY-NOTICES.md. Release history is maintained in CHANGELOG.md.
Content type
Image
Digest
sha256:74e36170d…
Size
122.9 MB
Last updated
about 12 hours ago
docker pull dgcosenza/gitea