Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

580 B
Raw Blame
# Builds verification agent binaries with different versions so the upgrade
# behaviour (v1 -> v2) can be tested. Built from ./cmd (not ./cmd/main.go)
# because the package has platform-split files.
FROM golang:1.26.3-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -ldflags "-X main.Version=v1.0.0" -o /out/agent-v1 ./cmd
RUN CGO_ENABLED=0 go build -ldflags "-X main.Version=v2.0.0" -o /out/agent-v2 ./cmd

FROM alpine:3.21
COPY --from=build /out/ /out/
CMD ["cp", "-v", "/out/agent-v1", "/out/agent-v2", "/artifacts/"]