Skip to content

Commit edcd8a4

Browse files
committed
Prepare file permissions in the build stage
Some files and directories were not readable by the image user. Issue: PGO-2695
1 parent ac44eac commit edcd8a4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
FROM docker.io/library/golang:bookworm AS build
66

7-
COPY licenses /licenses
8-
COPY hack/tools/queries /opt/crunchy/conf
9-
107
WORKDIR /usr/src/app
118
COPY . .
129

@@ -17,12 +14,15 @@ RUN --mount=type=cache,target=/var/cache \
1714
set -e
1815
go build ./cmd/postgres-operator
1916
go run ./hack/extract-licenses.go licenses postgres-operator
17+
18+
find ./hack/tools/queries '(' -type d -exec chmod 0555 '{}' + ')' -o '(' -type f -exec chmod 0444 '{}' + ')'
19+
find ./licenses '(' -type d -exec chmod 0555 '{}' + ')' -o '(' -type f -exec chmod 0444 '{}' + ')'
2020
SHELL
2121

2222
FROM docker.io/library/debian:bookworm
2323

24-
COPY --from=build --chmod=0444 /usr/src/app/licenses /licenses
25-
COPY --from=build --chmod=0444 /opt/crunchy/conf /opt/crunchy/conf
24+
COPY --from=build /usr/src/app/licenses /licenses
25+
COPY --from=build /usr/src/app/hack/tools/queries /opt/crunchy/conf
2626
COPY --from=build /usr/src/app/postgres-operator /usr/local/bin
2727

2828
USER 2

0 commit comments

Comments
 (0)