Skip to content
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

podman-remote build: COPY flattens hardlinks #10444

Closed
edsantiago opened this issue May 24, 2021 · 3 comments · Fixed by #10446
Closed

podman-remote build: COPY flattens hardlinks #10444

edsantiago opened this issue May 24, 2021 · 3 comments · Fixed by #10446
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote

Comments

@edsantiago
Copy link
Member

#10421 has a buglet: when hardlinks span subdirectories, the ones created in the image are flattened into the top level:

$ mkdir mytest;cd mytest
$ mkdir -p subdir/subsubdir
$ touch file1; ln file1 subdir/file2; ln file1 subdir/subsubdir/file3
$ printf "FROM alpine\nCOPY . .\n" >Containerfile
$ ../bin/podman-remote build -t foo .
STEP 1: FROM alpine
STEP 2: COPY . .
STEP 3: COMMIT foo
--> 24108ea85cc
Successfully tagged localhost/foo:latest
24108ea85cc9015a4391575b5821f3e9c35f72f890739ab019216a6a149e93c0
$ ../bin/podman run --rm foo ls -l | grep file
-rw-rw-r--    1 root     root            21 May 24 17:36 Containerfile
-rw-rw-r--    3 root     root             0 May 24 17:36 file1
-rw-rw-r--    3 root     root             0 May 24 17:36 file2    <-- should've been in subdir
-rw-rw-r--    3 root     root             0 May 24 17:36 file3    <-- should've been in subdir/subsubdir
@edsantiago edsantiago added the remote Problem is in podman-remote label May 24, 2021
@rhatdan
Copy link
Member

rhatdan commented May 24, 2021

Now you are just being evil.... :^)

@edsantiago
Copy link
Member Author

I accept that as a compliment! (side note: bug was found by running buildah-bud tests under podman-remote; so full cleverness credit goes to @nalind for writing a test, bud-copy-dockerignore-hardlinks, that catches the problem)

@rhatdan
Copy link
Member

rhatdan commented May 24, 2021

Well I always knew @nalind was evil. I spent a couple of hours doing something that ended up being a simple fix.

rhatdan added a commit to rhatdan/podman that referenced this issue May 24, 2021
mheon pushed a commit to mheon/libpod that referenced this issue May 25, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants