Skip to content

Instantly share code, notes, and snippets.

@jodh-intel
Created October 18, 2017 16:20
Show Gist options
  • Save jodh-intel/d716b0b6d6c406f8c2e077f6084a80b8 to your computer and use it in GitHub Desktop.
Save jodh-intel/d716b0b6d6c406f8c2e077f6084a80b8 to your computer and use it in GitHub Desktop.
Script to capture an OCI `config.json` config file before launching an OCI runtime
#!/bin/bash
# XXX: change as necessary
runtime="/home/james/go/src/github.com/clearcontainers/runtime/cc-runtime"
die()
{
msg="$*"
echo "ERROR: $msg" >&2
exit 1
}
for i in $@
do
# save the docker config for later inspection
[ -e "$i" -a -e "$i/config.json" ] && cp "$i/config.json" /tmp
done
[ -e "$runtime" ] || die "runtime does not exist: $runtime"
[ -x "$runtime" ] || die "runtime not executable: $runtime"
eval exec "$runtime" $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment