genuinetools / img

Standalone, daemon-less, unprivileged Dockerfile and OCI compatible container image builder.
https://blog.jessfraz.com/post/building-container-images-securely-on-kubernetes/
MIT License
3.88k stars 229 forks source link

"img unpack" hangs if -o is used with relative path #328

Open jdwx opened 3 years ago

jdwx commented 3 years ago

This was (probably) mentioned in issue #201 but seems like a separate issue.

These commands work:

$ cd /tmp; img unpack image:tag $ img unpack -o /tmp/rootfs image:tag

The commands hang indefinitely:

$ cd /tmp; img unpack -o rootfs image:tag $ cd /tmp; img unpack -o ./rootfs image:tag

Example output from debug:

$ ~/img unpack -d -o rootfs jdwx/alpine
DEBU[0000] checking runc                                 disableEmbeddedRunc=false state=/home/jdwx/.local/share/img
DEBU[0000] runc found                                    commit=56aca5aa50d07548d5db8fd33e9dc562f70f3208 spec=1.0.2 version=1.0.0-rc10+dev
DEBU[0000] checking runc                                 disableEmbeddedRunc=false state=/home/jdwx/.local/share/img
DEBU[0000] runc found                                    commit=56aca5aa50d07548d5db8fd33e9dc562f70f3208 spec=1.0.2 version=1.0.0-rc10+dev
DEBU[0000] using backend: overlayfs
WARN[0000] using host network as the default
DEBU[0000] Unpacking layer sha256:596ba82af5aaa3e2fd9d6f955b8b94f0744a2b60710e3c243ba3e4a467f051d1

Running "top" shows both img and runc spinning with 100% CPU usage.

The existing tests appear only to cover absolute paths because that's what ioutil.TempDir() returns.

tobwen commented 3 years ago

I can verify this on latest Debian 10 (AMD64).