Add Dockerfile
Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
This commit is contained in:
parent
de2fd6afb9
commit
a602d31206
1 changed files with 18 additions and 0 deletions
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
FROM golang:alpine as builder
|
||||||
|
RUN apk add --update --no-cache git ca-certificates
|
||||||
|
|
||||||
|
RUN mkdir /build
|
||||||
|
WORKDIR /build
|
||||||
|
COPY go.mod .
|
||||||
|
COPY go.sum .
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o rageshake
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=builder /build/rageshake /rageshake
|
||||||
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
WORKDIR /
|
||||||
|
EXPOSE 9110
|
||||||
|
CMD ["/rageshake"]
|
Reference in a new issue