agent/engine/dockerstate/docker_task_engine_state.go
func (state *DockerTaskEngineState) TaskByShortID(cid string) ([]*apitask.Task, bool) {
	containerIDs := state.GetAllContainerIDs()
	var tasks []*apitask.Task
	for _, id := range containerIDs {
		if strings.HasPrefix(id, cid) {
			if task, ok := state.TaskByID(id); ok {
				tasks = append(tasks, task)
			}
		}
	}
	return tasks, len(tasks) > 0
}
func (state *DockerTaskEngineState) TaskByShortID(cid string) ([]*apitask.Task, bool) {
	containerIDs := state.GetAllContainerIDs()
	var tasks []*apitask.Task
	for _, id := range containerIDs {
		if strings.HasPrefix(id, cid) {
			if task, ok := state.TaskByID(id); ok {
				tasks = append(tasks, task)
			}
		}
	}
	return tasks, len(tasks) > 0
}
// TaskByShortID retrieves the task of a given docker short container id