func (c *Container) Logs(id string, out, err io.Writer) {
	go func() {
		c.Client.Logs(dockerclient.LogsOptions{
			Container:    id,
			OutputStream: out,
			ErrorStream:  err,
			Follow:       true,
			Stdout:       true,
			Stderr:       true,
		})
	}()
}
Logs is calling dockerclient logs function
into a goroutine so we're not blocker by it
package engine
import (
	"fmt"
	log "github.com/Sirupsen/logrus"
	dockerclient "github.com/fsouza/go-dockerclient"
	"github.com/jbdalido/smg/utils"
	"io"
	"math/rand"
	"runtime"
	"strconv"
	"strings"
	"time"
)
type Container struct {
	ID               string
	Image            ImageName
	Name             string
	Tags             []string
	Hostname         string
	Code             int
	Privileged       bool
	Protection       bool
	Client           *dockerclient.Client
	HostConfig       *dockerclient.HostConfig
	ContainerConfig  *dockerclient.Config
	Docker           *dockerclient.Container
	Ports            []dockerclient.Port
	WorkingDirectory string
	Links            []*Container
}
func (c *Container) Inspect(id string) error {
	cont, err := c.Client.InspectContainer(id)
	if err != nil {
		return err
	}
	c.Docker = cont
	c.Name = c.Docker.Name
	return nil
}
func (c *Container) Exists(id string) bool {
	err := c.Inspect(id)
	if err != nil {
		return false
	}
	return true
}
func (c *Container) IsRunning(id string) bool {
	err := c.Inspect(id)
	if err != nil {
		return false
	}
	if !c.Docker.State.Running {
		return false
	}
	return true
}
func (c *Container) Start(out bool) (int, error) {
	if !c.IsRunning(c.Docker.ID) {
		err := c.Client.StartContainer(c.Docker.ID, c.HostConfig)
		if err != nil {
			return -1, err
		}
		if out {
			c.Logs(c.Docker.ID, utils.StdPre, utils.StdPre)
			c.Code, err = c.Client.WaitContainer(c.Docker.ID)
			if err != nil {
				return -1, nil
			}
		}
	}
	return c.Code, nil
}