roryqi opened a new pull request, #11533:
URL: https://github.com/apache/gravitino/pull/11533

   ### What changes were proposed in this pull request?
   
   Replace the post-COPY `RUN chmod -R g+rwX <dir>` step with `COPY 
--chmod=775` in three Dockerfiles:
   - `dev/docker/gravitino/Dockerfile`
   - `dev/docker/iceberg-rest-server/Dockerfile`
   - `dev/docker/lance-rest-server/Dockerfile`
   
   ### Why are the changes needed?
   
   `chmod -R` after `COPY` rewrites the mode of every file. With OverlayFS each 
modified file is copied up into the `RUN` layer, so the whole application tree 
(~1.9GB for the gravitino image) is stored twice, roughly doubling the image 
size. `COPY --chmod` sets the mode as the files are written, so there is only 
one copy.
   
   Measured on the gravitino image (`docker history`):
   
   | layer | before | after |
   |-------|--------|-------|
   | COPY app tree | 1.89 GB | 1.89 GB |
   | permission step | `chmod -R` = **1.89 GB** | `chmod +x`+`useradd` = **369 
kB** |
   
   Fix: #11532
   
   ### Does this PR introduce _any_ user-facing change?
   
   No API change. Published Docker images are ~1.9GB smaller. Note: files are 
now mode 775 instead of the previous `g+rwX` (which preserved existing execute 
bits); this only adds the execute bit to regular files and does not affect 
runtime behavior.
   
   ### How was this patch tested?
   
   Built the fixed image and verified with `docker history` that the duplicate 
~1.9GB chmod layer is gone (replaced by a 369kB permission layer). Ran the 
image as the non-root user (uid 1000): the server starts and serves the 
Gravitino REST (`/api/version`, metalake CRUD), Iceberg REST 
(`/iceberg/v1/config`) and Lance REST endpoints successfully.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to