move attach to a job

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Merge pull request #3512 from vieux/attach_job

move attach to a job