Initial commit
This commit is contained in:
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM golang:1.20-alpine as build-stage
|
||||
|
||||
RUN apk --no-cache add \
|
||||
g++ \
|
||||
git \
|
||||
make \
|
||||
bash
|
||||
|
||||
ARG VERSION
|
||||
ENV VERSION=${VERSION}
|
||||
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -o /hook --ldflags "-w -extldflags '-static' -X cmd.Version=${VERSION:-dev}" .
|
||||
|
||||
# Final image.
|
||||
FROM alpine:latest
|
||||
RUN apk --no-cache add \
|
||||
ca-certificates
|
||||
COPY --from=build-stage /hook /usr/local/bin/hook
|
||||
ENTRYPOINT ["/usr/local/bin/hook"]
|
||||
Reference in New Issue
Block a user