15 lines
393 B
Docker
15 lines
393 B
Docker
FROM golang:alpine AS builder
|
|
RUN apk update && apk add --no-cache git
|
|
RUN go install github.com/a-h/templ/cmd/templ@latest
|
|
|
|
WORKDIR $GOPATH/src/goipam
|
|
COPY . .
|
|
RUN rm web/templates/*_templ.go
|
|
RUN templ generate
|
|
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"]
|