Skip to content

"containerd oci-hook" does not pass the right rootfs #2412

@flx42

Description

@flx42

While testing #2330 with a custom rootfs, I got the following:

$ ctr run --rm --gpus 0 --rootfs ~/runc/ubuntu test /bin/bash
ctr: OCI runtime create failed: container_linux.go:336: starting container process caused "process_linux.go:402: container init caused \"process_linux.go:385: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: mount error: mount operation failed: /run/containerd/io.containerd.runtime.v1.linux/default/test/rootfs/proc/driver/nvidia: no such file or directory\\\\n\\\"\"": unknown

This is not the right rootfs, I believe this path will only work with the containerd snapshotter:

func (t *templateContext) rootfs() string {
return filepath.Join(t.state.Bundle, "rootfs")
}

Instead, the OCI runtime spec needs to be read to retrieve root.path. Unless we turn this rootfs into a symlink to the spec's rootfs, that would also work I guess and would prevent the spec parsing in this command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions