mirror of
https://github.com/hanzozt/zt.git
synced 2026-10-30 15:04:55 +00:00
ghcr.io/hanzozt/zt carries both roles and is built from this tree. hanzo.yml declares it for linux/amd64 and linux/arm64 and gates it on vet and the unit tests; cicd.yml hands it to hanzoai/ci, whose door builds each architecture natively. The deleted workflows built from dist/, which no longer exists, or pushed to docker.io. Co-authored-by: Hanzo Dev <[email protected]>
22 lines
732 B
Docker
22 lines
732 B
Docker
# One image, two roles: `zt controller` and `zt router`, both configured from
|
|
# the environment (`zt controller --help`, `zt router --help`).
|
|
FROM golang:1.26.5-alpine AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
ARG VERSION=0.0.0
|
|
ARG REVISION=local
|
|
RUN CGO_ENABLED=0 go build -trimpath -o /zt \
|
|
-ldflags "-s -w -X github.com/hanzozt/zt/v2/common/version.Version=v${VERSION#v} -X github.com/hanzozt/zt/v2/common/version.Revision=${REVISION}" \
|
|
./zt \
|
|
&& mkdir /state
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /zt /usr/local/bin/zt
|
|
COPY --from=build --chown=65532:65532 /state /state
|
|
ENV ZT_HOME=/state
|
|
USER 65532:65532
|
|
WORKDIR /state
|
|
ENTRYPOINT ["/usr/local/bin/zt"]
|