-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
I have run across an issue in another project that uses image-tools
, sylabs/singularity#3880, that looks to be caused by image-tools
failing to unpack files with the correct permissions. The issue appears when building from a Dockerfile when a file is created in one layer and then in a subsequent layer the permissions are modified. In this case it looks like the unpacked image has the original file permissions and the updated permissions are ignored.
Dockerfile
FROM ubuntu
RUN mkdir -m 700 /foobar
RUN chmod 755 /foobar
Building the image and verifying the permissions
$ docker build -t permission:test .
$ docker run permission:test ls -ld /foobar
drwxr-xr-x 1 root root 4096 Jul 7 02:43 /foobar
Copy the image with skopeo
$ skopeo copy docker-daemon:permission:test oci:permission:test
Verify permissions are correct with umoci
$ sudo umoci unpack --image permission:test permission_umoci
$ sudo ls -ld permission_umoci/rootfs/foobar
drwxr-xr-x 2 root root 4096 Jul 6 19:43 permission_umoci/rootfs/foobar
Permissions are incorrect with image-tools
$ oci-image-tool unpack --ref name=test permission permission_oit
$ ls -ld permission_oit/foobar
drwx------ 2 asimpson asimpson 4096 Jul 6 19:43 permission_oit/foobar
ax3l
Metadata
Metadata
Assignees
Labels
No labels