goipam/Dockerfile

15 lines
393 B
Docker
Raw Permalink Normal View History

2024-02-22 10:18:59 +01:00
FROM golang:alpine AS builder
RUN apk update && apk add --no-cache git
2024-02-22 20:52:37 +01:00
RUN go install github.com/a-h/templ/cmd/templ@latest
2024-02-22 10:18:59 +01:00
WORKDIR $GOPATH/src/goipam
COPY . .
2024-02-22 20:52:37 +01:00
RUN rm web/templates/*_templ.go
RUN templ generate
2024-02-22 10:18:59 +01:00
RUN go get -d -v
RUN go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/goipam
FROM scratch
COPY --from=builder /go/bin/goipam /go/bin/goipam
ENTRYPOINT ["/go/bin/goipam"]