Files
Ida NovindasariandFelix Kunde 1b4ffb0875 Separate pipeline for internal/external build and support multi arch (#2991)
* separate pipeline for internal/external build and support multi arch
* remove distutils and use node:lts-alpine in both
* change base image arguments
* fix local naming and base image
* address feedback

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-12-10 16:45:42 +01:00

27 lines
855 B
Docker

ARG BASE_IMAGE=alpine:latest
FROM golang:1.25-alpine AS builder
ARG VERSION=latest
COPY . /go/src/github.com/zalando/postgres-operator
WORKDIR /go/src/github.com/zalando/postgres-operator
RUN GO111MODULE=on go mod vendor \
&& CGO_ENABLED=0 go build -o build/postgres-operator -v -ldflags "-X=main.version=${VERSION}" cmd/main.go
FROM ${BASE_IMAGE}
LABEL maintainer="Team ACID @ Zalando <team-acid@zalando.de>"
LABEL org.opencontainers.image.source="https://github.com/zalando/postgres-operator"
# We need root certificates to deal with teams api over https
RUN apk -U upgrade --no-cache \
&& apk add --no-cache curl ca-certificates
COPY --from=builder /go/src/github.com/zalando/postgres-operator/build/* /
RUN addgroup -g 1000 pgo
RUN adduser -D -u 1000 -G pgo -g 'Postgres Operator' pgo
USER 1000:1000
ENTRYPOINT ["/postgres-operator"]