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.
rageshake/Dockerfile
realaravinth 5ab35a58a9
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
feat: build only x864 linux docker img
2022-08-18 15:44:52 +05:30

28 lines
735 B
Docker

ARG GO_VERSION=1.17
ARG DEBIAN_VERSION=11
ARG DEBIAN_VERSION_NAME=bullseye
## Build stage ##
FROM docker.io/library/golang:${GO_VERSION}-${DEBIAN_VERSION_NAME} AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
#RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o rageshake
RUN go build -o rageshake
## Runtime stage, debug variant ##
FROM gcr.io/distroless/static-debian${DEBIAN_VERSION}:debug-nonroot AS debug
COPY --from=builder /build/rageshake /rageshake
WORKDIR /
EXPOSE 9110
ENTRYPOINT ["/rageshake"]
## Runtime stage ##
FROM gcr.io/distroless/static-debian${DEBIAN_VERSION}:nonroot
COPY --from=builder /build/rageshake /rageshake
WORKDIR /
EXPOSE 9110
ENTRYPOINT ["/rageshake"]