To make use of SGX enclaves applications have to talk to the SGX driver which is exposed via /dev/isgx
on the host. We execute such applications inside of Docker containers mapping /dev/isgx
inside with the --device
command line option.
Is there an option to add a device (/dev/isgx
in this case) to any container ever started by a docker engine?
Edit:
Progress on my side so far:
Docker uses containerd
& runc
to create a containers configuration before it is started. Docker's configuration file /etc/docker/daemon.json
has a field runtimes
where one can provide arbitrary arguments to runc
:
[...]
"runtimes": {
"runc": {
"path": "runc"
},
"custom": {
"path": "/usr/local/bin/my-runc-replacement",
"runtimeArgs": [
"--debug"
]
}
},
[...]
Sadly, it seams runc
is not consuming to many useful arguments for my means (runc --help
and runc spec --help
<-- creates the configuration).
I found interesting source code regarding DefaultSimpleDevices
and DefaultAllowedDevices
in runc
's codebase. The last commit to this file says 'Do not create /dev/fuse by default' which is promising, but would involve building my own runc
. I was hoping for a generic solution via a configuration option.