fix: switch to using debian base images
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Aravinth Manivannan 2022-08-18 17:15:22 +05:30
parent befb3780cc
commit a536481248
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
1 changed files with 6 additions and 12 deletions

View File

@ -1,28 +1,22 @@
ARG GO_VERSION=1.17
ARG DEBIAN_VERSION=11
ARG DEBIAN_VERSION_NAME=bullseye
## Build stage ## ## Build stage ##
FROM docker.io/library/golang:${GO_VERSION}-${DEBIAN_VERSION_NAME} AS builder FROM golang as builder
WORKDIR /build WORKDIR /build
COPY go.mod go.sum ./ COPY go.mod go.sum ./
RUN go mod download RUN go mod download
COPY . . COPY . .
#RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o rageshake
RUN go build -o rageshake RUN go build -o rageshake
## Runtime stage, debug variant ## ## Runtime stage, debug variant ##
FROM gcr.io/distroless/static-debian${DEBIAN_VERSION}:debug-nonroot AS debug FROM debian:bullseye as debug
COPY --from=builder /build/rageshake /rageshake COPY --from=builder /build/rageshake /rageshake
WORKDIR / WORKDIR /
EXPOSE 9110 EXPOSE 9110
ENTRYPOINT ["/rageshake"] ENTRYPOINT ["/rageshake"]
## Runtime stage ## ## Runtime stage ##
FROM gcr.io/distroless/static-debian${DEBIAN_VERSION}:nonroot FROM debian:bullseye as rageshake
COPY --from=builder /build/rageshake /rageshake LABEL org.opencontainers.image.source https://git.batsense.net/mystiq/rageshake
WORKDIR / WORKDIR /
COPY --from=builder /build/rageshake /bin/
EXPOSE 9110 EXPOSE 9110
ENTRYPOINT ["/rageshake"] ENTRYPOINT ["/bin/rageshake"]