1ad6780df1
install.sh: - find_asset_url now matches by asset NAME (python3 JSON parse), not URL path — Gitea attachment URLs are opaque UUIDs that don't contain the tarball name. This was the root cause of the v0.12.18 install failure (asset existed but install.sh couldn't find it). - find_asset_in_releases walks recent releases by asset name and returns both URL + version for the fallback walk. - Handles 404 (tag without release) gracefully via fallback walk. Dockerfile: - golang:1.25 -> golang:1.25.12 (go.mod requires 1.25.12; the Docker image was using patch 0, causing `go mod download` to fail with "go.mod requires go >= 1.25.12 (running go 1.25.10)") coreci.yml: - All golang:1.25 images -> golang:1.25.12 - Release pipeline: add SHA256SUMS generation (sha256sum tarball) - Release pipeline: attach SHA256SUMS alongside tarball - Release pipeline: verify assets are actually attached after tea releases create (REQ-097 gate C-21); auto-attach via API if tea failed silently release.sh: - Add SHA256SUMS generation (sha256sum tarball > SHA256SUMS) ---ci--- project: orca milestone: v0.12.18 phase: release-fix status: complete ---/ci---
56 lines
1.7 KiB
Docker
56 lines
1.7 KiB
Docker
# Dockerfile — multi-stage build for orca
|
|
#
|
|
# Stage 1: build the static binary with golang:1.25
|
|
# Stage 2: distroless static runtime (CGO-free, ~2MB image)
|
|
#
|
|
# Build args:
|
|
# VERSION — semver tag injected via -ldflags (e.g. v0.4.4)
|
|
# GIT_COMMIT — short commit hash
|
|
# BUILD_TIME — ISO 8601 build timestamp
|
|
#
|
|
# Build:
|
|
# docker build --build-arg VERSION=v0.4.4 -t git.cloudinit.dev/coreci/orca:v0.4.4 .
|
|
#
|
|
# Run:
|
|
# docker run --rm git.cloudinit.dev/coreci/orca:v0.4.4 version
|
|
# docker run --rm -v orca-data:/var/lib/orca git.cloudinit.dev/coreci/orca:v0.4.4 init
|
|
|
|
ARG VERSION=dev
|
|
ARG GIT_COMMIT=unknown
|
|
ARG BUILD_TIME=unknown
|
|
|
|
# --- Stage 1: build -------------------------------------------------------
|
|
|
|
FROM golang:1.25.12 AS builder
|
|
|
|
ARG VERSION
|
|
ARG GIT_COMMIT
|
|
ARG BUILD_TIME
|
|
|
|
WORKDIR /src
|
|
|
|
# Cache module downloads — copy go.mod/go.sum first, download, then copy source.
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
# CGO_ENABLED=0 guarantees a static binary (modernc/sqlite is pure Go).
|
|
RUN CGO_ENABLED=0 go build -trimpath \
|
|
-ldflags="-s -w \
|
|
-X git.cloudinit.dev/coreci/orca/internal/cli.version=${VERSION} \
|
|
-X git.cloudinit.dev/coreci/orca/internal/cli.gitCommit=${GIT_COMMIT} \
|
|
-X git.cloudinit.dev/coreci/orca/internal/cli.buildTime=${BUILD_TIME}" \
|
|
-o /orca ./cmd/orca
|
|
|
|
# --- Stage 2: runtime -----------------------------------------------------
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
|
|
# ORCA_HOME points to a volume-mountable path inside the container.
|
|
# Mount a volume at /var/lib/orca to persist state across container restarts.
|
|
ENV ORCA_HOME=/var/lib/orca
|
|
|
|
COPY --from=builder /orca /orca
|
|
|
|
ENTRYPOINT ["/orca"] |