'Error -- > exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown.; when I convert an ISO image to tarball and docker import it

I am trying to create a container from the ISO image, trying following commands on ubuntu.

  1. curl -SLO https://download.fedoraproject.org/pub/fedora/linux/releases/35/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-35-1.2.iso
    
  2. sudo guestfish --ro -a Fedora-Workstation-Live-x86_64-35-1.2.iso -m /dev/sda1 tar-out / fedora-35.tar
    
  3. cat fedora-35.tar | docker import - fedora35:v1
    
  4. docker run 016ffc836ada /bin/sh
    docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown.
    ERRO[0001] error waiting for container: context canceled 
    
  5. For some reason the image inspect gives the json metadata null
     "Container": "",
         "ContainerConfig": {
             "Hostname": "",
             "Domainname": "",
             "User": "",
             "AttachStdin": false,
             "AttachStdout": false,
             "AttachStderr": false,
             "Tty": false,
             "OpenStdin": false,
             "StdinOnce": false,
             "Env": null,
             "Cmd": null,
             "Image": "",
             "Volumes": null,
             "WorkingDir": "",
             "Entrypoint": null,
             "OnBuild": null,
             "Labels": null
         },
         "DockerVersion": "20.10.7",
         "Author": "",
         "Config": {
             "Hostname": "",
             "Domainname": "",
             "User": "",
             "AttachStdin": false,
             "AttachStdout": false,
             "AttachStderr": false,
             "Tty": false,
             "OpenStdin": false,
             "StdinOnce": false,
             "Env": null,
             "Cmd": null,
             "Image": "",
             "Volumes": null,
             "WorkingDir": "",
             "Entrypoint": null,
             "OnBuild": null,
             "Labels": null
    

I have seen other similar posts but those did not help. Not sure how to fix it. Could you please advise? Thanks,



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source