Files
mesh-controller/examples/objectstore-provisioner/Dockerfile
T
jochen ef3e5ae9b0
mesh/merge-gate head ef3e5ae9b0dc merged into trunk 1d244d5aa24e — pass: builds build-agent, mesh-controller, route-proxy → ace, g14, novox, shanks; no bus…
mesh/repo-check head ef3e5ae9b0dc merged into trunk 1d244d5aa24e — pass: its merge-check.sh passed
mesh/delivery delivered
Stamp no commit in this repository's own image recipes either (hq issue 363, review of #292)
The genesis image copies the whole clone with .git, so its controller
carried the commit it was built at, as the bundles did.
2026-10-13 06:47:18 +02:00

34 lines
1.6 KiB
Docker

# The bucket provisioner, as a module ships one.
#
# Built here so a machine can be given it by the mesh rather than by somebody putting a binary on
# it.
#
# **Not FROM scratch, unlike the postgres one, and the difference is the point.** This drives the
# store's own command line, so that client has to be in the image — a provisioner is allowed to
# know how to operate the thing it provisions.
#
# The client is copied from the vendor's own image rather than installed from a distribution:
# `apk add mc` on Alpine installs Midnight Commander, which is a different program with the same
# name, and the failure would be a provisioner that starts cleanly and cannot do anything.
# The Go it builds with is the one the manifest pins (build.on GO_BASE), passed by the Makefile and the
# build machine alike; the default only serves a hand build, and matches go.mod.
ARG GO_BASE=golang:1.26-alpine
FROM ${GO_BASE} AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -buildvcs=false -ldflags '-s -w' \
-o /mesh-provision-objectstore ./examples/objectstore-provisioner
# Pinned like everything else the mesh runs (novox/hq ADR 0006): a tag moves and a digest does not.
FROM minio/mc:latest AS client
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
COPY --from=client /usr/bin/mc /usr/bin/mc
COPY --from=build /mesh-provision-objectstore /mesh-provision-objectstore
# Watching by default, because that is what makes it a module: an ordinary long-running service
# the host supervises, rather than something invoked after every declaration.
ENTRYPOINT ["/mesh-provision-objectstore", "--watch"]