Check jobs currently install Python and the lint tools from the internet on every run. A prebuilt image makes runs faster and reproducible, and moves all downloads to one reviewed build.
Enterprise practice: golden runner images, built by CI, scanned, stored in an internal registry and referenced by digest.
Add ci/Dockerfile: pinned base image (digest), lint tools from the hash-locked requirements, Betterleaks and Trivy with checksums
Build it in a workflow that runs only on main when ci/** changes, and push it to Gitea's built-in container registry
Build without the Docker socket (see #5), for example with Buildah; verify that it works in a job container on the runner VM (no Docker socket, no privileged mode)
Scan the image with Trivy before pushing
Run the check jobs in it via container: <registry>/homelab-ci@sha256:..., and drop setup-python and the runtime installs
Check jobs download nothing at run time, and the image they use is pinned by digest.
Check jobs currently install Python and the lint tools from the internet on every run. A prebuilt image makes runs faster and reproducible, and moves all downloads to one reviewed build.
**Enterprise practice:** golden runner images, built by CI, scanned, stored in an internal registry and referenced by digest.
Depends on #6 and #8.
## Steps
- [ ] Add `ci/Dockerfile`: pinned base image (digest), lint tools from the hash-locked requirements, Betterleaks and Trivy with checksums
- [ ] Build it in a workflow that runs only on `main` when `ci/**` changes, and push it to Gitea's built-in container registry
- [ ] Build without the Docker socket (see #5), for example with Buildah; verify that it works in a job container on the runner VM (no Docker socket, no privileged mode)
- [ ] Scan the image with Trivy before pushing
- [ ] Run the check jobs in it via `container: <registry>/homelab-ci@sha256:...`, and drop `setup-python` and the runtime installs
- [ ] Let Renovate bump the digest (#7)
## Tools
Gitea container registry, Buildah, Trivy.
## Done when
Check jobs download nothing at run time, and the image they use is pinned by digest.
Update: the new runner (#18) runs jobs in Docker containers instead of host mode, so container: <registry>/homelab-ci@sha256:... jobs will work on it. Jobs don't get the Docker socket (docker_host: "-"), so the "build without the Docker socket" step (e.g. Buildah) still applies.
Update: the new runner (#18) runs jobs in Docker containers instead of host mode, so `container: <registry>/homelab-ci@sha256:...` jobs will work on it. Jobs don't get the Docker socket (`docker_host: "-"`), so the "build without the Docker socket" step (e.g. Buildah) still applies.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Check jobs currently install Python and the lint tools from the internet on every run. A prebuilt image makes runs faster and reproducible, and moves all downloads to one reviewed build.
Enterprise practice: golden runner images, built by CI, scanned, stored in an internal registry and referenced by digest.
Depends on #6 and #8.
Steps
ci/Dockerfile: pinned base image (digest), lint tools from the hash-locked requirements, Betterleaks and Trivy with checksumsmainwhenci/**changes, and push it to Gitea's built-in container registrycontainer: <registry>/homelab-ci@sha256:..., and dropsetup-pythonand the runtime installsTools
Gitea container registry, Buildah, Trivy.
Done when
Check jobs download nothing at run time, and the image they use is pinned by digest.
Update: the new runner (#18) runs jobs in Docker containers instead of host mode, so
container: <registry>/homelab-ci@sha256:...jobs will work on it. Jobs don't get the Docker socket (docker_host: "-"), so the "build without the Docker socket" step (e.g. Buildah) still applies.