Makefile for build date
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
parent
06c3b47f47
commit
ba1c9438f3
|
@ -0,0 +1,14 @@
|
||||||
|
BUILD=`date +%FT%T%z`
|
||||||
|
|
||||||
|
LDFLAGS=-ldflags "-X main.buildDate=${BUILD}"
|
||||||
|
|
||||||
|
.PHONY: build deps static
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build ${LDFLAGS}
|
||||||
|
|
||||||
|
deps:
|
||||||
|
go get
|
||||||
|
|
||||||
|
static:
|
||||||
|
CGO_ENABLED=0 GOOS=linux go build ${LDFLAGS} -a -installsuffix cgo -o karaokards .
|
|
@ -2,9 +2,8 @@ FROM golang@sha256:cee6f4b901543e8e3f20da3a4f7caac6ea643fd5a46201c3c2387183a332d
|
||||||
RUN apk update && apk add --no-cache git make ca-certificates && update-ca-certificates
|
RUN apk update && apk add --no-cache git make ca-certificates && update-ca-certificates
|
||||||
COPY main.go /go/src/git.martyn.berlin/martyn/karaokards/
|
COPY main.go /go/src/git.martyn.berlin/martyn/karaokards/
|
||||||
COPY internal/ /go/src/git.martyn.berlin/martyn/karaokards/internal/
|
COPY internal/ /go/src/git.martyn.berlin/martyn/karaokards/internal/
|
||||||
RUN cd /go/src/git.martyn.berlin/martyn/karaokards/; go get; CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o karaokards .
|
COPY Makefile /go/src/git.martyn.berlin/martyn/karaokards/
|
||||||
#RUN ls /go/src/github.com/karaokards/ -l
|
RUN cd /go/src/git.martyn.berlin/martyn/karaokards/; make deps ; make static
|
||||||
|
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
|
Loading…
Reference in New Issue