properly detect already running instances

docker ps|grep $cid .. fails due to grepping the non-truncated CID against 'docker ps' which truncates by default.