podinfo icon indicating copy to clipboard operation
podinfo copied to clipboard

Can I get a non-alpine image for podinfo

Open manidharanupoju24 opened this issue 1 year ago • 1 comments

Need to use podinfo in our kubernetes clusters. Our operator currently doesn't support non-alpine images. It would be great if we could a non-alpine image for the exact same app. @stefanprodan

manidharanupoju24 avatar Nov 26 '23 05:11 manidharanupoju24

You in theory should be able to just do the below and it work

FROM golang:1.22-alpine as builder

ARG REVISION

RUN mkdir -p /podinfo/

WORKDIR /podinfo

COPY . .

RUN go mod download

RUN CGO_ENABLED=0 go build -ldflags "-s -w \
    -X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
    -a -o bin/podinfo cmd/podinfo/*

RUN CGO_ENABLED=0 go build -ldflags "-s -w \
    -X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
    -a -o bin/podcli cmd/podcli/*

- FROM alpine:3.20
+ FROM ubuntu

ARG BUILD_DATE
ARG VERSION
ARG REVISION

LABEL maintainer="stefanprodan"

RUN addgroup -S app \
    && adduser -S -G app app \
    && apk --no-cache add \
    ca-certificates curl netcat-openbsd

WORKDIR /home/app

COPY --from=builder /podinfo/bin/podinfo .
COPY --from=builder /podinfo/bin/podcli /usr/local/bin/podcli
COPY ./ui ./ui
RUN chown -R app:app ./

USER app

CMD ["./podinfo"]

Why exactly do you need a non-alpine image? Security? You can use a chainguard base if you so desire

userbradley avatar Jun 10 '24 10:06 userbradley