Created
October 18, 2017 16:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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