Skip to content

fix: create links in entrypoint for files under /home/tooling/.config - #225

Closed
dkwon17 wants to merge 3 commits into
devfile:mainfrom
dkwon17:persist-config-files
Closed

fix: create links in entrypoint for files under /home/tooling/.config#225
dkwon17 wants to merge 3 commits into
devfile:mainfrom
dkwon17:persist-config-files

Conversation

@dkwon17

@dkwon17 dkwon17 commented Jul 10, 2025

Copy link
Copy Markdown
Collaborator

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
dkwon17 requested review from SDawley and svor as code owners July 10, 2025 21:56
@openshift-ci

openshift-ci Bot commented Jul 10, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dkwon17

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

Details 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

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 <dakwon@redhat.com>
@dkwon17
dkwon17 force-pushed the persist-config-files branch from 96f2812 to d0a7011 Compare July 10, 2025 22:15
Comment thread base/ubi9/.copy-files Outdated
Comment thread base/ubi9/.copy-files Outdated
@rohanKanojia

Copy link
Copy Markdown
Member

I tested this PR with abovementioned steps and can confirm it's working as expected

dkwon17 added 2 commits July 11, 2025 11:07
Signed-off-by: David Kwon <dakwon@redhat.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
@dkwon17

dkwon17 commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator Author

Closing in favour of #226

@dkwon17 dkwon17 closed this Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants