forked from CrunchyData/postgres-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 858 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright 2017 - 2026 Crunchy Data Solutions, Inc.
#
# SPDX-License-Identifier: Apache-2.0
FROM docker.io/library/golang:bookworm AS build
WORKDIR /usr/src/app
COPY . .
ENV GOCACHE=/var/cache/go
ENV GOMODCACHE=/var/cache/gomod
RUN --mount=type=cache,target=/var/cache \
<<-SHELL
set -e
go build ./cmd/postgres-operator
go run ./hack/extract-licenses.go licenses postgres-operator
find ./hack/tools/queries '(' -type d -exec chmod 0555 '{}' + ')' -o '(' -type f -exec chmod 0444 '{}' + ')'
find ./licenses '(' -type d -exec chmod 0555 '{}' + ')' -o '(' -type f -exec chmod 0444 '{}' + ')'
SHELL
FROM docker.io/library/debian:bookworm
COPY --from=build /usr/src/app/licenses /licenses
COPY --from=build /usr/src/app/hack/tools/queries /opt/crunchy/conf
COPY --from=build /usr/src/app/postgres-operator /usr/local/bin
USER 2
CMD ["postgres-operator"]