Skip to content

Commit ed9f59a

Browse files
authored
Merge pull request #551 from SebLz/fix/non-root-perms
Fix write permissions for arbitrary UID / non-root users (OpenShift requirement)
2 parents 26b8f20 + e75f294 commit ed9f59a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ ENV PIPELINES_URLS=${PIPELINES_URLS} \
5151
# Copy the application code
5252
COPY . .
5353

54+
# Fix write permissions for OpenShift / non-root users
55+
RUN set -eux; \
56+
for d in /app /root /.local /.cache; do \
57+
mkdir -p "$d"; \
58+
done; \
59+
chgrp -R 0 /app /root /.local /.cache || true; \
60+
chmod -R g+rwX /app /root /.local /.cache || true; \
61+
find /app -type d -exec chmod g+s {} + || true; \
62+
find /root -type d -exec chmod g+s {} + || true; \
63+
find /.local -type d -exec chmod g+s {} + || true; \
64+
find /.cache -type d -exec chmod g+s {} + || true
65+
5466
# Run a docker command if either PIPELINES_URLS or PIPELINES_REQUIREMENTS_PATH is not empty
5567
RUN if [ -n "$PIPELINES_URLS" ] || [ -n "$PIPELINES_REQUIREMENTS_PATH" ]; then \
5668
echo "Running docker command with PIPELINES_URLS or PIPELINES_REQUIREMENTS_PATH"; \

0 commit comments

Comments
 (0)