提交 dded84d5 编写于 作者: K Kevin Klues 提交者: Renaud Gaubert

Update README with working example

上级 773b1954
......@@ -36,9 +36,11 @@ Refer to the [nvidia-container-runtime](https://github.com/NVIDIA/nvidia-contain
### Command line example
```bash
# Setup a rootfs based on Ubuntu 16.04 inside new namespaces
# Setup a new set of namespaces
cd $(mktemp -d) && mkdir rootfs
sudo unshare --mount --pid --fork
# Setup a rootfs based on Ubuntu 16.04 inside the new namespaces
curl http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-amd64.tar.gz | tar -C rootfs -xz
useradd -R $(realpath rootfs) -U -u 1000 -s /bin/bash nvidia
mount --bind rootfs rootfs
......@@ -52,7 +54,7 @@ mount -t tmpfs none tmp
mount -t tmpfs none run
# Isolate the first GPU device along with basic utilities
nvidia-container-cli --load-kmods configure --no-cgroups --utility --device 0 .
nvidia-container-cli --load-kmods configure --ldconfig=@/sbin/ldconfig.real --no-cgroups --utility --device 0 $(pwd)
# Change into the new rootfs
pivot_root . mnt
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册