goshorly/Dockerfile

20 lines
634 B
Text
Raw Normal View History

2021-12-07 19:10:53 +01:00
FROM golang:alpine as builder
2021-12-07 15:49:58 +01:00
2021-12-08 10:07:31 +00:00
RUN apk add --no-cache gcc libgo git
2021-12-07 15:49:58 +01:00
2021-12-07 18:09:14 +01:00
WORKDIR /go/src/git.ucode.space/goshorly
2021-12-07 16:15:19 +01:00
COPY . .
2021-12-07 15:49:58 +01:00
2021-12-07 16:15:19 +01:00
RUN go get -d -v ./...
2022-01-06 18:53:02 +01:00
2022-01-06 18:57:39 +01:00
# RUN export I_PACKAGE="git.ucode.space/Phil/goshorly/utils" && \
# export I_GitCommitShort=$(git rev-parse --short HEAD) && \
# export I_GitBranch=$(git rev-parse --abbrev-ref HEAD) && \
# go build -a -installsuffix cgo -ldflags "-X $I_PACKAGE.GitCommitShort=$I_GitCommitShort -X $I_PACKAGE.GitBranch=$I_GitBranch" -o app .
RUN go build -o app .
2021-12-07 18:09:14 +01:00
2021-12-07 19:10:53 +01:00
FROM scratch as production
WORKDIR /goshorly
2022-01-05 23:44:11 +01:00
COPY --from=builder /go/src/git.ucode.space/goshorly/app /goshorly/app
2021-12-07 19:10:53 +01:00
CMD ["./app"]