Repository navigation
fix(ui): grant read and execute permissions to entrypoint script and nginx config in OCI image - #886
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Dockerfile generation in build_ui_oci.py to explicitly set read permissions on the Nginx configuration and execute permissions on the entrypoint script, alongside adding corresponding test assertions in build_ui_oci_test.py. Feedback suggests optimizing the Dockerfile by using the --chmod option directly within the COPY instructions to reduce image layers. Additionally, the reviewer pointed out a fragile command-parsing bug in the test helper that fails when flags like --platform are present, recommending a safer approach that always targets the last element of the command list.
…nginx config in OCI image Ensure /etc/nginx/conf.d/default.conf has a+r and /docker-entrypoint.d/generate_config.sh has a+rx permissions in the built Docker image. When building container images in environments with a restrictive umask (such as 027), files copied into the Docker build context lack read permissions for other users. Running under a non-root securityContext (e.g., runAsUser: 1000) caused the entrypoint script execution to fail with 'Permission denied'. Adding explicit world-read permissions to the Nginx configuration and read+execute permissions to the entrypoint script ensures the container starts reliably across non-root execution environments. TAG=agy CONV=e98e0073-5a75-4ef2-9a16-fdd19a94ccb2
andrzejfudro
force-pushed
the
fix/ui-entrypoint-permissions
branch
from
September 15, 2026 11:59
48b87c8 to
7498514
Compare
andrzejfudro
marked this pull request as ready for review
September 15, 2026 12:15
andrzejfudro
enabled auto-merge
September 15, 2026 12:15
janzak-dev
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ensures
/etc/nginx/conf.d/default.confhasa+rand/docker-entrypoint.d/generate_config.shhasa+rxpermissions in the generated UI OCI image. This prevents container startup crashes when running under non-root Kubernetes security contexts.Motivation & Context
When building container images in host environments with restrictive umasks (such as
027), files copied into the Docker build context do not have read permissions for other users. When the UI container runs in Kubernetes under a non-rootsecurityContext(runAsNonRoot: true,runAsUser: 1000), the entrypoint script/docker-entrypoint.shis unable to read/docker-entrypoint.d/generate_config.shand fails withPermission denied, causing continuous container crash loops.Explicitly setting read permissions on the Nginx configuration and read+execute permissions on the entrypoint script ensures that non-root users can execute the entrypoint script and start Nginx reliably.
Key Changes
cmd/ui/build_ui_oci.py: AddedRUN chmod a+r /etc/nginx/conf.d/default.confand updated entrypoint permissions toRUN chmod a+rx /docker-entrypoint.d/generate_config.shacross both pre-compiled and fallback multi-stage build paths.Assumptions
None — requirements were fully specified.
Verification & Testing
./.githooks/pre-commitRelated Issues / Bugs
N/A
TAG=agy
CONV=e98e0073-5a75-4ef2-9a16-fdd19a94ccb2