Files
pipelines/Dockerfile
alan 05ae530442 Make Pipelines Docker-only with OpenCode and Pi
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers.

Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent.

Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
2026-10-11 23:00:25 +01:00

56 lines
2.8 KiB
Docker

# Defaults are the last verified reproducible pins. Setup overrides them with
# the current resolved release versions and immutable image digest; the moving
# `latest` tag and version-only references are never used. OPENCODE_DIGEST has
# no default so a bare build cannot silently fall back to a version tag.
ARG OPENCODE_IMAGE=ghcr.io/anomalyco/opencode
ARG OPENCODE_VERSION=2.0.26
ARG OPENCODE_DIGEST
ARG PI_VERSION=1.1.0
FROM golang:1.27-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG PIPELINES_VERSION=dev
ARG PIPELINES_COMMIT=unknown
ARG PIPELINES_DIRTY=unknown
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-X git.a-wan.net/alan/pipelines/internal/buildinfo.Version=${PIPELINES_VERSION} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Commit=${PIPELINES_COMMIT} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Dirty=${PIPELINES_DIRTY}" -o /out/pipelines-server ./cmd/pipelines-server
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-X git.a-wan.net/alan/pipelines/internal/buildinfo.Version=${PIPELINES_VERSION} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Commit=${PIPELINES_COMMIT} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Dirty=${PIPELINES_DIRTY}" -o /out/pipelines ./cmd/pipelines
FROM ${OPENCODE_IMAGE}@${OPENCODE_DIGEST}
ARG OPENCODE_VERSION
ARG OPENCODE_DIGEST
ARG PI_VERSION
ARG PIPELINES_VERSION=dev
ARG PIPELINES_COMMIT=unknown
ARG PIPELINES_DIRTY=unknown
# Identity labels let setup verify the built image's actual source and harness
# pins without a running-container probe or trusting a sidecar receipt file.
LABEL net.a-wan.pipelines.opencode-version="${OPENCODE_VERSION}" \
net.a-wan.pipelines.opencode-digest="${OPENCODE_DIGEST}" \
net.a-wan.pipelines.pi-version="${PI_VERSION}" \
net.a-wan.pipelines.source-version="${PIPELINES_VERSION}" \
net.a-wan.pipelines.source-commit="${PIPELINES_COMMIT}" \
net.a-wan.pipelines.source-dirty="${PIPELINES_DIRTY}"
USER root
RUN apk add --no-cache ca-certificates tzdata git curl nodejs npm python3 \
&& npm install --global --ignore-scripts @earendil-works/pi-coding-agent@${PI_VERSION} \
&& addgroup -g 10001 pipelines \
&& adduser -D -u 10001 -G pipelines -h /home/pipelines pipelines \
&& mkdir -p /data /workspace \
&& chown -R pipelines:pipelines /data /workspace /home/pipelines
COPY --from=build /out/pipelines-server /usr/local/bin/pipelines-server
COPY --from=build /out/pipelines /usr/local/bin/pipelines
COPY --from=build /usr/local/go /usr/local/go
COPY --chown=10001:10001 . /workspace
ENV HOME=/home/pipelines \
PATH=/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
GOPATH=/home/pipelines/go \
CGO_ENABLED=0
WORKDIR /workspace
USER 10001:10001
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/pipelines-server"]
CMD ["-addr", "0.0.0.0:8080", "-db", "/data/pipelines.db"]