I’ve been trying to download and mount an img file inside a docker container to add some files to a partition then unmount.
I can run my script through fine on Ubuntu itself but am hitting some limitation with mount when trying to run the same script under docker.
I pre-create the /mnt/img folder and then calculate the offset using “fdisk -l file.img” and multiply by 512 to get the offset shown below.
The mount command itself is;
mount file.img -o loop,offset=4194304 /mnt/img
I just get the following message back;
mount: /mnt/img: mount failed: Operation not permitted.
I have tried using --privileged and --cap-add=SYS_ADMIN and finally with disabling apparmour in the underlying Ubuntu host machine without success. Is this just not possible?