15 lines
No EOL
548 B
Docker
15 lines
No EOL
548 B
Docker
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.10.0 AS xx
|
|
FROM --platform=$BUILDPLATFORM golang:1.27.4-alpine AS build
|
|
ARG TARGETPLATFORM
|
|
ARG GOPROXY
|
|
COPY --from=xx / /
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY ./ ./
|
|
RUN CGO_ENABLED=0 GOOS=linux xx-go build -ldflags "-w -s" -o /shelly-exporter .
|
|
|
|
FROM jonasled.dev/infra/images/scratch-rootless:latest@sha256:9e291c85277e40987bdbc84af228b4b40db5c24e1634d047465e2198ed9302e8
|
|
ENV GIN_MODE=release
|
|
COPY --from=build ./shelly-exporter /shelly-exporter
|
|
ENTRYPOINT ["/shelly-exporter"] |