import ( "github.com/docker/machine/drivers/virtualbox" ) func createMachine() error { options := virtualbox.DriverOptions{ UseInternalIP: true, } driver := virtualbox.NewDriver("default", "/path/to/virtualbox", options) // create machine using driver }
import ( "github.com/docker/machine/drivers/aws" "github.com/docker/machine/libmachine" ) func createMachine() error { options := aws.DriverOptions{ AMI: "ami-0123456789", } driver := aws.NewDriver("default", "access-key", "secret-key", options, libmachine.NewClient()) driver.SetConfigFromFlags() driver.SetSwarmConfigFromFlags() // create machine using driver }In this example, we set the `AMI` boolean option to "ami-0123456789" for the aws driver.