minikube: none driver doesn't start if /bin/bash doesn't exist.
Command:
minikube --logtostderr start -p sentinel --vm-driver none
Output: https://gist.github.com/alunduil/1e78933095fc69402ec0dc2e0927724f Minikube logs: https://gist.github.com/alunduil/a05cc1071bb0cf709f875817198d20f8 My os-release: https://gist.github.com/alunduil/f49e9aa43b826de82011eada8dc4cf75
In NixOS, there is no /bin/bash so starting the none driver fails to function. A simple fix for this error would be to use /usr/bin/env to invoke bash by following the path rather than assuming that it’s hard coded, but I’m not sure what other assumptions that might break. This solution should work because NixOS ensures a symlink exists at /usr/bin/env that points at the executable and most distributions that I’m aware of ship with /usr/bin/env.
If that sounds like a reasonable solution, I can work on figuring out a pull request (unless someone can get to it faster).
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- Use exec.LookPath to find full path of binaries in ExecRunner instead of using /bin/bash Issue #4122 — committed to palnabarun/minikube by palnabarun 5 years ago
@alunduil I would love to see removing the depdendecy on bash, however some commands we have in bootstrapper, does use bash functions,
as part of this PR https://github.com/kubernetes/minikube/pull/5530 a lot of the commands were converted to exec.Cmd format in this PR but others need more work to do so.
I would review any PR that carefully converts the commands to exec.Cmd format ( with args as oppsed to /bin/bash/ -c
A quick
LookPathshould fix this.Thanks @alunduil for the insights. 😃 I will test it out inside a NixOS VM.
@palnabarun that’s my understanding as well. You can do a quick test that this is working by creating a chroot or other isolated environment and ensure that bash can be found by looking the in the PATH when stored in a non-standard location.
Alternatively, if you want to setup a NixOS VM, testing should be direct in that environment since there isn’t any /bin/bash.
Alternatively - perhaps this should just use
/bin/sh. We shouldn’t be doing anything bash specific.