Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dkwon17
Copy link
Collaborator

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

openshift-ci bot commented Jul 10, 2025

[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.

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 <[email protected]>
@dkwon17 dkwon17 force-pushed the persist-config-files branch from 96f2812 to d0a7011 Compare July 10, 2025 22:15
@rohanKanojia
Copy link

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

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