Skip to content

Instantly share code, notes, and snippets.

@duglin
Last active April 27, 2016 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duglin/cc799056126143d93bd9c2e0c8a88a5d to your computer and use it in GitHub Desktop.
Save duglin/cc799056126143d93bd9c2e0c8a88a5d to your computer and use it in GitHub Desktop.
Simple case - no hooks, etc:
runc create --name=test --process=myapp
or if you need hooks, etc... :
runc create --name=test
# process is just "sleep"
# creates a new container will all new NSs
# do pre-start hooks here
runc create --attach=test --ns=all --process=myapp
# creates a new container but attaches to all NSs from "test"
# when 'myapp' is done, no NSs are deleted because it didn't create them, "test" did.
# Note, there's an implied "runc delete" for this nested container
# do post-stop hooks here
runc delete --name=test
# this deletes all of test's NSs since it created them
I guess --process isn't right since it gets it from the config.json, but I added it just to show what the PID process is in each case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment