Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docker/DebugDockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
FROM registry.opensource.zalan.do/library/alpine-3.15:latest
FROM golang:1.22-alpine
LABEL maintainer="Team ACID @ Zalando <team-acid@zalando.de>"

# We need root certificates to deal with teams api over https
RUN apk --no-cache add ca-certificates go git musl-dev
RUN apk -U add --no-cache ca-certificates delve

COPY build/* /

RUN addgroup -g 1000 pgo
RUN adduser -D -u 1000 -G pgo -g 'Postgres Operator' pgo

RUN go get -d github.com/derekparker/delve/cmd/dlv
RUN cp /root/go/bin/dlv /dlv
RUN chown -R pgo:pgo /dlv

USER pgo:pgo
RUN ls -l /

Expand Down
13 changes: 5 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
ARG BASE_IMAGE=registry.opensource.zalan.do/library/alpine-3:latest
FROM golang:1.22-alpine AS builder
ARG VERSION=latest

FROM ubuntu:20.04 as builder

ARG VERSION

COPY . /go/src/github.com/zalando/postgres-operator
WORKDIR /go/src/github.com/zalando/postgres-operator

ENV OPERATOR_LDFLAGS="-X=main.version=${VERSION}"
RUN bash docker/build_operator.sh
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 --no-cache add curl
RUN apk --no-cache add ca-certificates
RUN apk -U upgrade --no-cache \
&& apk add --no-cache curl ca-certificates

COPY --from=builder /go/src/github.com/zalando/postgres-operator/build/* /

Expand Down