indigo-dc / udocker

A basic user tool to execute simple docker containers in batch or interactive systems without root privileges.
https://indigo-dc.github.io/udocker/
Apache License 2.0
1.36k stars 132 forks source link

udocker cannot load my image.tar created by docker save (failed to extract container) #361

Closed Root-voidX closed 2 years ago

Root-voidX commented 2 years ago

When I try to use udocker load -i I get this error:

 ai-fe  qemu  ~  udocker --version
version: 1.3.2
tarball: https://download.ncg.ingrid.pt/webdav/udocker/udocker-englib-1.2.8.tar.gz https://raw.githubusercontent.com/jorge-lip/udocker-builds/master/tarballs/udocker-englib-1.2.8.tar.gz
tarball_release: 1.2.8

 ai-fe  qemu  ~  udocker load -i CentOS-7-DockerImage
CentOS-7-DockerImage/    CentOS-7-DockerImage.7z  

 ai-fe  qemu  ~  udocker load -i CentOS-7-DockerImage/CentOS-7-DockerImage.tar 
Error: failed to extract container: CentOS-7-DockerImage/CentOS-7-DockerImage.tar
Error: load failed
mariojmdavid commented 2 years ago

hi can you tell me which linux distro you are using? I have tested this successfully in my desktop ubuntu22.04

docker save centos:7 -o centos7.tar
mkdir somedir
mv centos7.tar somedir/
udocker load -i somedir/centos7.tar 
udocker images
REPOSITORY
centos:7   
fcasson commented 1 year ago

We found a similar issue for CentOS and Rockylinux based tarballs which contain some layers referenced as symlinks. I think this behaviour may have arisen with newer versions of docker (maybe buildkit?) or udocker, since we did not have it in the past.

udocker verify points to the problem layers which can be seen in the tarball to be the symlink layers

Two workarounds

Somewhat related discussion about this behaviour appearing: https://forums.docker.com/t/docker-save-images-image-tarball-has-symlinks-between-layers/52022/2

EDIT: I realised our issue is at the udocker create not udocker load step, so probably not relevant to this issue. Will open a new issue if can find steps to reproduce with an image from dockerhub.

EDIT2: When playing around with udocker load, I noticed that there is a difference between

udocker load -i somefile.tar # fails
udocker load -i ./somefile.tar # works