This repository has been archived on 2022-08-18. You can view files and clone it, but cannot push or open issues or pull requests.
2022-01-20 16:13:13 +05:30
|
|
|
ARG GO_VERSION=1.17
|
|
|
|
ARG DEBIAN_VERSION=11
|
|
|
|
ARG DEBIAN_VERSION_NAME=bullseye
|
|
|
|
|
|
|
|
# Build stage
|
|
|
|
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:${GO_VERSION}-${DEBIAN_VERSION_NAME} as builder
|
2019-03-07 19:12:18 +05:30
|
|
|
|
|
|
|
WORKDIR /build
|
2022-01-20 16:13:13 +05:30
|
|
|
COPY go.mod go.sum ./
|
2019-03-07 19:12:18 +05:30
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY . .
|
2022-01-20 16:13:13 +05:30
|
|
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o rageshake
|
2019-03-07 19:12:18 +05:30
|
|
|
|
2022-01-20 16:13:13 +05:30
|
|
|
# Runtime stage
|
|
|
|
FROM --platform=${TARGETPLATFORM} gcr.io/distroless/static-debian${DEBIAN_VERSION}:nonroot
|
2019-03-07 19:12:18 +05:30
|
|
|
COPY --from=builder /build/rageshake /rageshake
|
|
|
|
WORKDIR /
|
|
|
|
EXPOSE 9110
|
2022-01-20 16:13:13 +05:30
|
|
|
ENTRYPOINT ["/rageshake"]
|