1
0
Fork 0
concourse-kvm/runc-wrapper

28 lines
450 B
Bash
Executable File

#!/bin/sh
RUNC=${RUNC:=runc}
if [ -f config.json ]; then
mv config.json config.old.json
jq -c '.mounts |= . + [
{
"destination": "/dev/kvm",
"type": "bind",
"source": "/dev/kvm",
"options": [ "bind", "rw" ]
}
] |
.linux.resources.devices |= . + [
{
"allow": true,
"type": "c",
"major": 10,
"minor": 232,
"access": "rwm"
}
]' config.old.json > config.json
cp config.json /tmp/config.json
fi
exec $RUNC "$@"