fix(docker): Resolve liburing.so.2 loading error for non-root users #987

Merged
tcpipuk merged 1 commit from tom/fix-liburing into main 2025-09-07 13:43:45 +00:00
Owner

Container failed to start when running as non-root (user 1000:1000) because copied directories had restrictive 770 permissions, likely due to different umask in persistent BuildKit. Non-root users couldn't access /usr/lib to load required dynamic libraries.

Adds --chmod=755 to all COPY commands to explicitly set permissions and improves library extraction with robust lddtree processing. Also fixes workflow syntax error and removes docker/** from paths-ignore to ensure Docker changes trigger CI builds.

Container failed to start when running as non-root (user 1000:1000) because copied directories had restrictive 770 permissions, likely due to different umask in persistent BuildKit. Non-root users couldn't access /usr/lib to load required dynamic libraries. Adds `--chmod=755` to all COPY commands to explicitly set permissions and improves library extraction with robust lddtree processing. Also fixes workflow syntax error and removes `docker/**` from paths-ignore to ensure Docker changes trigger CI builds.
tcpipuk self-assigned this 2025-09-07 11:28:31 +00:00
fix(docker): Include liburing runtime library for io_uring support
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 2m10s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m59s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 19m53s
c9a597a184
The lddtree step wasn't detecting liburing.so.2 as a dependency, likely
because rocksdb loads it dynamically at runtime. Add explicit detection
and copying of liburing libraries to ensure they're available in the
final runtime image.
fix(ci): Repair release-image workflow and improve library detection
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 53s
Release Docker Image / define-variables (pull_request) Successful in 4s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m8s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 10m5s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Successful in 9m33s
Release Docker Image / merge (pull_request) Successful in 9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 15m46s
869f22c6d8
Remove syntax error in build args and enable workflow to trigger on docker
changes. Improve Dockerfile library detection script robustness with better
error handling and command construction.
fix(docker): Set proper permissions for non-root container execution
All checks were successful
Release Docker Image / define-variables (pull_request) Successful in 22s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m7s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 6m10s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 9m5s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Successful in 9m1s
Release Docker Image / merge (pull_request) Successful in 8s
d7e4348234
Adds --chmod=755 to all COPY commands in the scratch image to ensure
directories and files are readable by non-root users. This fixes the
liburing.so.2 loading error when running as user 1000:1000.

Also reorders COPY layers for better caching: libraries, binaries, then SBOM.
tcpipuk force-pushed tom/fix-liburing from d7e4348234 to a9c1d165d7 2025-09-07 12:22:15 +00:00 Compare
tcpipuk changed title from fix(docker): Include liburing runtime library for io_uring support to fix(docker): Resolve liburing.so.2 loading error for non-root users 2025-09-07 12:23:37 +00:00
tcpipuk force-pushed tom/fix-liburing from a9c1d165d7 to d92da9d8e6 2025-09-07 12:38:13 +00:00 Compare
tcpipuk force-pushed tom/fix-liburing from d92da9d8e6 to 7b3055be37 2025-09-07 12:54:16 +00:00 Compare
tcpipuk force-pushed tom/fix-liburing from 7b3055be37 to 0d9a9aa388 2025-09-07 12:56:57 +00:00 Compare
tcpipuk force-pushed tom/fix-liburing from 0d9a9aa388 to 4dd1cbc803 2025-09-07 12:58:27 +00:00 Compare
tcpipuk force-pushed tom/fix-liburing from 4dd1cbc803 to fff9629b0f 2025-09-07 13:13:26 +00:00 Compare
Author
Owner

It was fun resolving this permission issue... COPY --chmod in Docker apparently only modifies the files, not the directories, so I've added a little prepper stage between the builder and the scratch output so it can organise the files into "layers" and set the mode correctly before copying the layers into the final scratch for export.

I can confirm this has resolved the permissions issue for me, either way!

It was fun resolving this permission issue... `COPY --chmod` in Docker apparently only modifies the files, not the directories, so I've added a little `prepper` stage between the `builder` and the scratch output so it can organise the files into "layers" and set the mode correctly before copying the layers into the final scratch for export. I can confirm this has resolved the permissions issue for me, either way!
tcpipuk deleted branch tom/fix-liburing 2025-09-07 13:43:45 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: continuwuation/continuwuity#987
No description provided.