func composeUp(d driver.DistroDriver, json map[string]interface{}) error {
	if len(json) == 0 {
		log.Println("docker-compose config not specified, noop")
		return nil
	}

	// Convert json to yaml
	yaml, err := yaml.Marshal(json)
	if err != nil {
		return fmt.Errorf("error converting to compose.yml: %v", err)
	}

	tmpDir, err := ioutil.TempDir(os.TempDir(), "compose")
	if err != nil {
		return fmt.Errorf("failed creating temp dir: %v", err)
	}
	log.Printf("Using compose yaml:---------\n%s\n----------", string(yaml))
	ymlPath := filepath.Join(tmpDir, composeYml)
	if err := ioutil.WriteFile(ymlPath, yaml, 0666); err != nil {
		return fmt.Errorf("error writing yaml: %v", err)
	}

	compose := filepath.Join(d.DockerComposeDir(), composeBin)
	return executil.ExecPipe(compose, "-f", ymlPath, "up", "-d")
}
func loginRegistry(s dockerLoginSettings) error {
	if !s.HasLoginInfo() {
		log.Println("registry login not specificied")
		return nil
	}
	opts := []string{
		"login",
		"--email=" + s.Email,
		"--username="******"--password="******"" {
		opts = append(opts, s.Server)
	}
	return executil.ExecPipe("docker", opts...)
}
func (u ubuntuBaseDriver) InstallDocker() error {
	return executil.ExecPipe("/bin/sh", "-c", "wget -qO- https://get.docker.com/ | sh")
}
func (u ubuntuBaseDriver) UninstallDocker() error {
	if err := executil.ExecPipe("apt-get", "-qqy", "purge", "lxc-docker"); err != nil {
		return err
	}
	return executil.ExecPipe("apt-get", "-qqy", "autoremove")
}
func (d upstartBaseDriver) RestartDocker() error {
	if err := executil.ExecPipe("update-rc.d", "docker", "defaults"); err != nil {
		return err
	}
	return executil.ExecPipe("service", "docker", "restart")
}
func (d upstartBaseDriver) StopDocker() error {
	return executil.ExecPipe("service", "docker", "stop")
}
func (d systemdBaseDriver) RestartDocker() error {
	if err := executil.ExecPipe("systemctl", "daemon-reload"); err != nil {
		return err
	}
	return executil.ExecPipe("systemctl", "restart", "docker")
}
func (d systemdBaseDriver) StopDocker() error {
	return executil.ExecPipe("systemctl", "stop", "docker")
}