Skip to content

podman-remote build: COPY does not preserve hardlinks #9893

@edsantiago

Description

@edsantiago
$ cat Containerfile
FROM alpine
COPY . .
$ touch file1
$ ln file1 file2
$ ln file1 file3
$ ../bin/podman-remote build -t foo .
STEP 1: FROM alpine
STEP 2: COPY . .
STEP 3: COMMIT foo
--> 27caa37d33e
27caa37d33e63b26e39ac49f936de3eb6645dadb45cf70babba270f2f06c5fb0
$ ../bin/podman run --rm foo ls -li / | grep file
23744516 -rw-rw-r--    1 root     root            21 Mar 30 20:08 Containerfile
23744517 -rw-rw-r--    1 root     root             0 Mar 30 20:08 file1
23744518 -rw-rw-r--    1 root     root             0 Mar 30 20:08 file2
23744519 -rw-rw-r--    1 root     root             0 Mar 30 20:08 file3

Note that all inodes are different (expected: same for fileN), and each file's hard link count is 1 (expected: 3).

Works as expected with buildah and with non-remote podman. This almost certainly has to do with the copying of the context directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.remoteProblem is in podman-remote

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions