Skip to content

maint(resources): Docker container changes permissions to match the file owner uid and gid#14900

Merged
Markus-SWAG merged 6 commits intomasterfrom
fix/common/match-container-permissions
Nov 4, 2025
Merged

maint(resources): Docker container changes permissions to match the file owner uid and gid#14900
Markus-SWAG merged 6 commits intomasterfrom
fix/common/match-container-permissions

Conversation

@Markus-SWAG
Copy link
Copy Markdown
Contributor

@Markus-SWAG Markus-SWAG commented Oct 7, 2025

There is an issue that the Docker containers cannot modify the
files on KEYMAN_ROOT, since the user running build and tests on
Docker does not have the same gid and uid as the host user starting
the container.
The issue is solved by temporarily changing the uid and gid to
match the container user's uid and gid.

Test-bot: skip
Build-bot: skip

@keymanapp-test-bot
Copy link
Copy Markdown

User Test Results

Test specification and instructions

User tests are not required

@Markus-SWAG Markus-SWAG marked this pull request as draft October 7, 2025 15:21
@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S13 milestone Oct 7, 2025
@ermshiperete ermshiperete changed the title Docker container changes permissions to match the file owner uid and gid maint(resources): Docker container changes permissions to match the file owner uid and gid Oct 8, 2025
@ermshiperete
Copy link
Copy Markdown
Contributor

What uid/gid do we get if we run this as GHA?

uid=\$(stat -c "%u" /home/build/build)
gid=\$(stat -c "%g" /home/build/build)

if [[ "\${uid}" != "\$(id -u)" || "\${gid}" != "\$(id -g)" ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be

Suggested change
if [[ "\${uid}" != "\$(id -u)" || "\${gid}" != "\$(id -g)" ]]; then
if [[ "\${uid}" != "\$(id -u)" && "\${gid}" != "\$(id -g)" ]]; then

It is sufficient if either the user or the group matches.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

"\${@:-bash}"
fi

if [[ "\${uid}" != "\$(id -u)" || "\${gid}" != "\$(id -g)" ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ "\${uid}" != "\$(id -u)" || "\${gid}" != "\$(id -g)" ]]; then
if [[ "\${uid}" != "\$(id -u)" && "\${gid}" != "\$(id -g)" ]]; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@darcywong00 darcywong00 modified the milestones: A19S13, A19S14 Oct 11, 2025
There is an issue that the Docker containers cannot modify the
files on KEYMAN_ROOT, since the user running build and tests on
Docker does not have the same gid and uid as the host user starting
the container.
The issue is solved by temporarily changing the uid and gid to
match the container user's uid and gid.

Test-bot: skip
Build-bot: skip
@Markus-SWAG Markus-SWAG force-pushed the fix/common/match-container-permissions branch from 70b02d1 to c9b44d3 Compare October 22, 2025 13:41
@github-actions github-actions bot added the maint Maintenance work -- continuous integration, build scripts, infrastructure label Oct 22, 2025
@Markus-SWAG Markus-SWAG marked this pull request as ready for review October 22, 2025 16:19
@darcywong00 darcywong00 modified the milestones: A19S14, A19S15 Oct 24, 2025
Markus-SWAG and others added 2 commits November 4, 2025 22:48
Forgotten to remove when CHANGE_PERMISSIONS was invented.

Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
@Markus-SWAG Markus-SWAG merged commit f92483d into master Nov 4, 2025
6 checks passed
@Markus-SWAG Markus-SWAG deleted the fix/common/match-container-permissions branch November 4, 2025 22:06
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Nov 4, 2025
@keyman-server
Copy link
Copy Markdown
Collaborator

Changes in this pull request will be available for download in Keyman version 19.0.156-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maint Maintenance work -- continuous integration, build scripts, infrastructure resources/

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants