roryqi opened a new pull request, #11659:
URL: https://github.com/apache/gravitino/pull/11659
### What changes were proposed in this pull request?
Add `chmod 775 <server-home>` to the RUN step of the gravitino,
iceberg-rest-server and lance-rest-server Dockerfiles so the directory
created by `WORKDIR` becomes group-writable.
### Why are the changes needed?
PR #11533 replaced `chmod -R g+rwX <dir>` with `COPY --chmod=775`. However
`COPY --chmod` only applies to the copied contents, not to the target
directory itself, which was created earlier by `WORKDIR` and retains the
default `755 root:root` permission. The container runs as `uid=1000, gid=0`,
so the non-root user cannot create subdirectories such as
`/opt/gravitino/logs`, and the server fails at startup:
```
main ERROR Unable to create file /opt/gravitino/logs/gravitino-server.log
java.io.IOException: Could not create directory /opt/gravitino/logs
```
A single non-recursive `chmod 775` on the top directory fixes this while
preserving #11533's goal of not duplicating an image layer from a recursive
chmod.
Fix: #11652
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Built the real gravitino image via `dev/docker/build-docker.sh` and ran it
as `uid=1000, gid=0`:
- `/opt/gravitino` now has `drwxrwxr-x` (775) instead of `755`.
- The server starts, creates `/opt/gravitino/logs/gravitino-server.log`,
and `GET /api/version` returns HTTP 200.
- Confirmed the previous `Could not create directory` error no longer
appears.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]