The GCP counterpart of devops-lib. Registered in Jenkins under the same name, so consuming repos need no change: the two-line Jenkinsfile is identical on both clusters, and which library it resolves to is a property of the Jenkins running it. Substantive changes, all consequences of GKE being a real cloud: - Harbor speaks TLS here, so dind no longer passes --insecure-registry. It mounts the private CA at /etc/docker/certs.d/harbor.35.238.248.203.nip.io/ca.crt instead, from the registry-ca ConfigMap. This is not redundant with the node pool's trust: that covers pulls, performed by containerd on the node, while the push comes from dockerd in the build pod with its own trust store. Without it, pushes fail TLS verification while pulls of the same image succeed — which reads like a broken registry rather than a missing trust anchor. - The registry hostname changes in the push target and all five fallback Dockerfiles. It still must be spelled identically everywhere, because Docker matches credentials and trust by exact hostname. - helm_repo_url moves to cluster DNS. That clone runs in a build pod, so sending it out through the ingress and back would make the pipeline depend on Contour for pod-to-pod traffic. syncArgoApp already addressed ArgoCD this way and needed no change. - build-tools.Dockerfile is removed: devops-base-images-gcp owns it now, next to the mirrored base images, and the pod references the result by tag at base-images/build-tools:1. The base-images project is public, so the pod can pull it before it has any credentials. Verified: no homelab addresses remain; the pod template parses with the CA mount, the new image and no insecure-registry flag; and every fallback template's base image, with the default version buildDocker would pick, is present in the mirror manifest — an unmirrored tag now fails the build rather than silently falling back to Docker Hub. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEsTefWWifp4ikvhHF5s6N
19 lines
998 B
Plaintext
19 lines
998 B
Plaintext
# Fallback only — see go-Dockerfile's header comment for the general
|
|
# rule, including the Harbor base-images sourcing (also applies here).
|
|
# Simplified from the real python-*-Dockerfile set (which had four
|
|
# separate version-pinned files, 2.7/3.7/3.10.12/3.13) into one
|
|
# version-parametrized template. Assumes a standard requirements.txt +
|
|
# app.py (Flask/FastAPI-style `app:app` target for gunicorn) repo.
|
|
# Switched from python:*-slim (Debian) to python:*-alpine — smaller,
|
|
# still keeps a shell (not distroless). Caveat: pip packages with C
|
|
# extensions that only ship glibc wheels may need musl-dev/gcc added
|
|
# here to build from source on Alpine — fine for this repo's pure-Python
|
|
# deps, worth knowing if a future repo's requirements.txt needs more.
|
|
FROM harbor.35.238.248.203.nip.io/base-images/python:${version}-alpine
|
|
WORKDIR /app
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY . .
|
|
EXPOSE 8080
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|