Skip to content

podman build adds /run files in generated layers #3523

Closed

Description

/kind bug

Description

[root@cosa-devsh ~]# cat Dockerfile 
FROM registry.fedoraproject.org/fedora:34
RUN touch /usr/share/foo
[root@cosa-devsh ~]# docker build -t localhost/test -f Dockerfile .
...
[root@cosa-devsh ~]# skopeo copy docker-daemon:localhost/test:latest dir:test
...
[root@cosa-devsh ~]# tar tvf ./test/cc7c8bc3a77e6317c27cdfb659cb1267547a7e1857abd537fccd0f45ba6e8758 
drwxr-xr-x 0/0               0 2021-08-09 05:48 usr/
drwxr-xr-x 0/0               0 2021-09-16 13:43 usr/share/
-rw-r--r-- 0/0               0 2021-09-16 13:43 usr/share/foo
[root@cosa-devsh ~]#

As you'd expect, docker generates a tar stream that contains just my changes. But podman:

[root@cosa-devsh ~]# podman build -t localhost/test -f Dockerfile .
...
Successfully tagged localhost/test:latest
61f3f759198d49a50a3218c5e3cec2670195eeec9f40ca1db4026d78c909ef4a
[root@cosa-devsh ~]# skopeo copy containers-storage:localhost/test dir:podman-test
[root@cosa-devsh ~]# tar tvf podman-test/899c057a7dab966503bcfc550ff04f6bb2f99141bba0fe4662ad35aacb4afa97 
drwxr-xr-x root/root         0 2021-09-16 13:48 run/
-rwx------ root/root         0 2021-09-16 13:48 run/.containerenv
drwxr-xr-t root/root         0 2021-09-16 13:48 run/secrets/
drwxr-xr-x root/root         0 2021-08-09 05:48 usr/
drwxr-xr-x root/root         0 2021-09-16 13:48 usr/share/
-rw-r--r-- root/root         0 2021-09-16 13:48 usr/share/foo
[root@cosa-devsh ~]# 

Output of podman version:

[root@cosa-devsh ~]# podman version
Version:      3.3.0
API Version:  3.3.0
Go Version:   go1.17
Built:        Fri Aug 20 18:55:56 2021
OS/Arch:      linux/amd64

Package info (e.g. output of rpm -q podman or apt list podman):

podman-3.3.0-1.fc36.x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions