Hey everyone! I have a bit of a technical question. Is it actually feasible to run a virtual machine (VM) inside a Docker container for continuous integration (CI) purposes in GitLab? I'm currently working on a FUSE project, and I want to set up CI that spins up a VM to run integration tests and then sends the results back to GitLab. My main concern is avoiding the need for privileged containers during CI jobs, as going through the approval process for even small changes can be really frustrating. I get that Docker uses the host's kernel and isn't fully virtualized, so I'm wondering if this is a good approach or if there are better alternatives. I'd love to hear your thoughts and suggestions. Thanks!
2 Answers
Have you considered just creating more containers for the processes needed for your integration tests? That might be a lot more straightforward than trying to run a VM inside Docker.
To run hardware-assisted VMs, you’ll definitely need a privileged container. What’s the specific problem that's driving you toward using a VM? Maybe we can find a different solution.
I can't use a FUSE filesystem without a privileged container though, since it needs access to /dev/fuse.