Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I get a non-alpine image for podinfo #323

Open
manidharanupoju24 opened this issue Nov 26, 2023 · 1 comment
Open

Can I get a non-alpine image for podinfo #323

manidharanupoju24 opened this issue Nov 26, 2023 · 1 comment

Comments

@manidharanupoju24
Copy link

manidharanupoju24 commented Nov 26, 2023

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

@userbradley
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants