Skip to content

Commit

Permalink
Only require docker for the docker runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Nov 6, 2018
1 parent b9a4f94 commit 0fcdbd2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ the following drivers:
* [hyperkit](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver)
* [xhyve](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#xhyve-driver)
* [hyperv](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperV-driver)
* none (**Linux + docker daemon as container runtime only**) - this driver can be used to run the Kubernetes cluster components on the host instead of in a VM. This can be useful for CI workloads which do not support nested virtualization.
* none (**Linux-only**) - this driver can be used to run the Kubernetes cluster components on the host instead of in a VM. This can be useful for CI workloads which do not support nested virtualization.

```shell
$ minikube start
Expand Down
1 change: 1 addition & 0 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func runStart(cmd *cobra.Command, args []string) {
CPUs: viper.GetInt(cpus),
DiskSize: diskSizeMB,
VMDriver: viper.GetString(vmDriver),
ContainerRuntime: viper.GetString(containerRuntime),
HyperkitVpnKitSock: viper.GetString(vpnkitSock),
HyperkitVSockPorts: viper.GetStringSlice(vsockPorts),
XhyveDiskDriver: viper.GetString(xhyveDiskDriver),
Expand Down
15 changes: 9 additions & 6 deletions pkg/drivers/none/none.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ var dockerkillcmd = fmt.Sprintf(`docker rm $(%s)`, dockerstopcmd)
type Driver struct {
*drivers.BaseDriver
*pkgdrivers.CommonDriver
URL string
URL string
ContainerRuntime string
}

func NewDriver(hostName, storePath string) *Driver {
Expand All @@ -54,11 +55,13 @@ func NewDriver(hostName, storePath string) *Driver {

// PreCreateCheck checks for correct privileges and dependencies
func (d *Driver) PreCreateCheck() error {
// check that docker is on path
_, err := exec.LookPath("docker")
if err != nil {
return errors.Wrap(err, "docker cannot be found on the path for this machine. "+
"A docker installation is a requirement for using the none driver")
if d.ContainerRuntime == "" {
// check that docker is on path
_, err := exec.LookPath("docker")
if err != nil {
return errors.Wrap(err, "docker cannot be found on the path for this machine. "+
"A docker installation is a requirement for using the none driver")
}
}

return nil
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type MachineConfig struct {
CPUs int
DiskSize int
VMDriver string
ContainerRuntime string
HyperkitVpnKitSock string // Only used by the Hyperkit driver
HyperkitVSockPorts []string // Only used by the Hyperkit driver
XhyveDiskDriver string // Only used by the xhyve driver
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/drivers/none/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ func createNoneHost(config cfg.MachineConfig) interface{} {
MachineName: cfg.GetMachineName(),
StorePath: constants.GetMinipath(),
},
ContainerRuntime: config.ContainerRuntime,
}
}

0 comments on commit 0fcdbd2

Please sign in to comment.