summaryrefslogtreecommitdiffhomepage
path: root/g3doc/user_guide/tutorials/cni.md
diff options
context:
space:
mode:
authorIan Lewis <ianlewis@google.com>2020-07-09 15:25:35 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-09 15:26:52 -0700
commite506fcd9314d3402c9e83974e9cc335348b53360 (patch)
treecd741c809ca6cf2b7bc894478510c6d76a72e2b9 /g3doc/user_guide/tutorials/cni.md
parent8d2910a04dec5ef2c79034d35fce68e9f414d144 (diff)
Add args and netns flag to runsc spec
Adds a netns flag to runsc spec that allows users to specify a network namespace path when creating a sample config.json file. Also, adds the ability to specify the command arguments used when running the container. This will make it easier for new users to create sample OCI bundles without having to edit the config.json by hand. PiperOrigin-RevId: 320486267
Diffstat (limited to 'g3doc/user_guide/tutorials/cni.md')
-rw-r--r--g3doc/user_guide/tutorials/cni.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/g3doc/user_guide/tutorials/cni.md b/g3doc/user_guide/tutorials/cni.md
index ad6c9fa59..ce2fd09a8 100644
--- a/g3doc/user_guide/tutorials/cni.md
+++ b/g3doc/user_guide/tutorials/cni.md
@@ -128,12 +128,14 @@ sudo mkdir -p rootfs/var/www/html
sudo sh -c 'echo "Hello World!" > rootfs/var/www/html/index.html'
```
-Next create the `config.json` specifying the network namespace. `sudo
-/usr/local/bin/runsc spec sudo sed -i 's;"sh";"python", "-m", "http.server";'
-config.json sudo sed -i "s;\"cwd\": \"/\";\"cwd\": \"/var/www/html\";"
-config.json sudo sed -i "s;\"type\": \"network\";\"type\":
-\"network\",\n\t\t\t\t\"path\": \"/var/run/netns/${CNI_CONTAINERID}\";"
-config.json`
+Next create the `config.json` specifying the network namespace.
+
+```
+sudo /usr/local/bin/runsc spec \
+ --cwd /var/www/html \
+ --netns /var/run/netns/${CNI_CONTAINERID} \
+ -- python -m http.server
+```
## Run the Container