See https://gist.github.com/marineam/9914debc25c8d7dc458f
It uses the same toolchain as the one that built the CoreOS kernel and it doesn't require running Ubuntu. I haven't tested it, but I think the current approach results in a much larger driver image than necessary.
Perhaps this approach would work, for a given CoreOS release XYZ:
- Grab
cuda_*run and extract it to a directory on the host machine. You can't do that inside the container, because it doesn't have enough space to download the archive, let alone expand it, etc.
- Prepare a shell script to be run on the target nodes, which performs sanity checks, then runs
insmod
- Run container version XYZ using systemd-nspawn, adding
--bind for the cuda directory, the script and any other files/directories needed. Make nspawn run a Makefile or similar (CoreOS doesn't ship with Make, but the container does!), which perhaps outputs a tar file with just the driver, a shell script and maybe insmod
- Run
docker import to create a Docker image from the tarball (which can be piped), with version XYZ and the shell script as the entrypoint
- ???
- Profit!
What do you think? There'd be no Dockerfile left, at the end, but it might be worth it.
See https://gist.github.com/marineam/9914debc25c8d7dc458f
It uses the same toolchain as the one that built the CoreOS kernel and it doesn't require running Ubuntu. I haven't tested it, but I think the current approach results in a much larger driver image than necessary.
Perhaps this approach would work, for a given CoreOS release XYZ:
cuda_*runand extract it to a directory on the host machine. You can't do that inside the container, because it doesn't have enough space to download the archive, let alone expand it, etc.insmod--bindfor the cuda directory, the script and any other files/directories needed. Make nspawn run a Makefile or similar (CoreOS doesn't ship with Make, but the container does!), which perhaps outputs a tar file with just the driver, a shell script and maybe insmoddocker importto create a Docker image from the tarball (which can be piped), with version XYZ and the shell script as the entrypointWhat do you think? There'd be no Dockerfile left, at the end, but it might be worth it.