func (sw Swarm) Run(cont *engine.Container) (err error) { // Add image affinity to ensure that image is on same node aff := fmt.Sprintf("affinity:image==%s", cont.Image.Name) cont.Env = append(cont.Env, aff) return sw.engine.Run(cont) }