The release gate stamps the version into `task build`, and the distribution step packages those binaries instead of compiling the tree a second time with different flags. `task build` is static to match. The image builds keep Go's compile cache between runs. canary and promote take archied from the published edge image. The Woodpecker gate and pull-request check keep Go's caches on the host. Also: one Node version, the distribution waits for the archied image, release notes wait for the signed release and carry the prerelease flag.
39 lines
1.4 KiB
Docker
39 lines
1.4 KiB
Docker
# archied — the archie daemon
|
|
# Run via docker compose alongside NATS.
|
|
|
|
FROM node:24-trixie-slim AS dashboard
|
|
WORKDIR /src/ui
|
|
RUN corepack enable
|
|
COPY ui/package.json ui/pnpm-lock.yaml ui/pnpm-workspace.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
COPY ui/ ./
|
|
RUN pnpm run build
|
|
|
|
FROM golang:1.27-trixie AS builder
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
COPY --from=dashboard /src/ui/dist ./ui/dist
|
|
ARG GATEWAY_VERSION=dev
|
|
ARG RUNTIME_VERSION=dev
|
|
# COPY . . invalidates this layer on every commit; the compile cache outlives it.
|
|
RUN --mount=type=cache,id=archie-go-build,target=/root/.cache/go-build \
|
|
CGO_ENABLED=0 go build \
|
|
-ldflags "-X github.com/samcharles93/archie-core/internal/buildinfo.Version=${GATEWAY_VERSION} -X github.com/samcharles93/archie-core/internal/buildinfo.Runtime=${RUNTIME_VERSION} -X github.com/samcharles93/archie-core/internal/installtype.buildType=container" \
|
|
-o /usr/local/bin/archied ./cmd/archied/
|
|
|
|
FROM debian:trixie-slim
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates git && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
COPY --from=builder /usr/local/bin/archied /usr/local/bin/archied
|
|
ARG GATEWAY_VERSION=dev
|
|
ARG RUNTIME_VERSION=dev
|
|
LABEL org.opencontainers.image.version="${GATEWAY_VERSION}"
|
|
LABEL cloud.catlow.archie.runtime-version="${RUNTIME_VERSION}"
|
|
|
|
COPY CHANGELOG.md /usr/share/archie/CHANGELOG.md
|
|
|
|
ENTRYPOINT ["archied"]
|