#FROM alpine:latest AS build
FROM golang:1.25-alpine3.22 AS build

WORKDIR /app
#COPY handlers services *.go go.* /app/
COPY . /app/

RUN --mount=type=cache,target=/root/.cache/go-build  --mount=type=cache,target=/root/go/pkg/mod ./pre-go.sh && ./go.sh 

FROM scratch
#FROM golang:1.25-alpine3.22
COPY --from=build /app/uconfigd-controller.linux.arm /uconfigd-controller
COPY --from=build /app/uconfigd-controller* /app/*log /

# docker build --output=. .

