Skip to content

Conversation

dkwon17
Copy link
Collaborator

@dkwon17 dkwon17 commented Jul 29, 2025

Files under /home/tooling/.config are not stowed in the entrypoint because it is in the .stow-local-ignore file. Stow ignores everything in the .config folder because the /home/user/.config folder should be created in the entrypoint in order to have proper user permissions required for Podman 5.x.

This PR fixes https://issues.redhat.com/browse/CRW-8932

See #197

How I tested this PR:

  1. Build the base image. My base image is: quay.io/dkwon17/base-developer-image:persist-config-files.
cd base/ubi9 && podman image build -t  {base image} .
  1. Create the following files somewhere in your filesystem:
Dockerfile
FROM {base image}

COPY test.conf /home/tooling/.config/test/test-nested.conf
COPY test.conf /home/tooling/.config/test.conf
COPY test.conf /home/tooling/.config/test/another/test1.conf
COPY test.conf /home/tooling/.config/test/another/test2.conf
COPY test.conf /home/tooling/.config/composer/keys.dev.pub
COPY test.conf /home/tooling/.config/composer/keys.tags.pub
test.conf
test file
  1. Build the image from step 2. I've named my image quay.io/dkwon17/test:persist-config-files
podman build -t {image}.
  1. Run the image (podman run {image}) and exec into it. Verify that there are links from files under /home/tooling/.config to /home/user/.config:
~ $ cd .config/
.config $ ls -la
total 4
drwxr-xr-x. 1 user user 62 Jul 10 21:33 .
drwxrwx---. 1 user root 26 Jul 10 21:33 ..
drwxr-xr-x. 1 user user 50 Jul 10 21:33 composer
drwxr-xr-x. 1 user user 24 Jul 10 21:33 containers
drwxr-xr-x. 1 user user 46 Jul 10 21:33 test
lrwxrwxrwx. 1 user user 31 Jul 10 21:33 test.conf -> /home/tooling/.config/test.conf
.config $ cd test
test $ ls -la
total 4
drwxr-xr-x. 1 user user 46 Jul 10 21:33 .
drwxr-xr-x. 1 user user 62 Jul 10 21:33 ..
drwxr-xr-x. 1 user user 40 Jul 10 21:33 another
lrwxrwxrwx. 1 user user 43 Jul 10 21:33 test-nested.conf -> /home/tooling/.config/test/test-nested.conf
test $ cd another/
another $ ls -la
total 8
drwxr-xr-x. 1 user user 40 Jul 10 21:33 .
drwxr-xr-x. 1 user user 46 Jul 10 21:33 ..
lrwxrwxrwx. 1 user user 45 Jul 10 21:33 test1.conf -> /home/tooling/.config/test/another/test1.conf
lrwxrwxrwx. 1 user user 45 Jul 10 21:33 test2.conf -> /home/tooling/.config/test/another/test2.conf
another $ cd ../../composer/
composer $ ls -la
total 8
drwxr-xr-x. 1 user user 50 Jul 10 21:33 .
drwxr-xr-x. 1 user user 62 Jul 10 21:33 ..
lrwxrwxrwx. 1 user user 43 Jul 10 21:33 keys.dev.pub -> /home/tooling/.config/composer/keys.dev.pub
lrwxrwxrwx. 1 user user 44 Jul 10 21:33 keys.tags.pub -> /home/tooling/.config/composer/keys.tags.pub

dkwon17 added 3 commits July 10, 2025 18:15
Files under /home/tooling/.config are not stowed in the entrypoint
because it is in the .stow-local-ignore file. Stow ignores everything in
the .config folder because the /home/user/.config folder should be
created in the entrypoint in order to have proper user permissions
required for Podman 5.x.

Signed-off-by: David Kwon <[email protected]>
Signed-off-by: David Kwon <[email protected]>
Copy link

Pull Request images published ✨

UDI: quay.io/devfile/universal-developer-image:pr-226

@dkwon17
Copy link
Collaborator Author

dkwon17 commented Jul 30, 2025

Hello @svor could you please review this PR?

Copy link
Collaborator

@svor svor left a comment

Choose a reason for hiding this comment

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

LGTM
Tested using instructions form the description.
@dkwon17 could you please explain how or where .copy-files file is used

Copy link

openshift-ci bot commented Jul 31, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dkwon17, svor

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dkwon17
Copy link
Collaborator Author

dkwon17 commented Jul 31, 2025

Thank you for the review, .copy-files is meant for anyone who wants to extend the udi base image and wants to copy files from /home/tooling/* to /home/user/* from the image entrypoint.

Right now Che doesn't depend on this feature anywhere, it's a feature that is very helpful for moving /home/tooling/.config files to /home/user/.config because .config is ignored by stow since this PR was merged #209

@svor
Copy link
Collaborator

svor commented Jul 31, 2025

@dkwon17 Thank you for the explanation

@dkwon17 dkwon17 merged commit 5f15a0a into main Aug 1, 2025
12 of 15 checks passed
@dkwon17 dkwon17 deleted the persist-config-files branch August 1, 2025 14:58
eye0fra pushed a commit to openlab-red/developer-images that referenced this pull request Aug 12, 2025
…devfile#226)

* fix: create links in entrypoint for files under /home/tooling/.config

Files under /home/tooling/.config are not stowed in the entrypoint
because it is in the .stow-local-ignore file. Stow ignores everything in
the .config folder because the /home/user/.config folder should be
created in the entrypoint in order to have proper user permissions
required for Podman 5.x.

Signed-off-by: David Kwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants